Class: Gateway::Worldpay

Inherits:
Gateway
  • Object
show all
Defined in:
app/models/spree/gateway/worldpay.rb

Instance Method Summary collapse

Instance Method Details

#authorize(money, credit_card, options = {}) ⇒ Object



24
25
26
27
# File 'app/models/spree/gateway/worldpay.rb', line 24

def authorize(money, credit_card, options = {})
  provider = credit_card_provider(credit_card, options)
  provider.authorize(money, credit_card, options)
end

#capture(money, authorization, options = {}) ⇒ Object



29
30
31
32
# File 'app/models/spree/gateway/worldpay.rb', line 29

def capture(money, authorization, options = {})
  provider = credit_card_provider(auth_credit_card(authorization), options)
  provider.capture(money, authorization, options)
end

#credit(money, authorization, options = {}) ⇒ Object



39
40
41
# File 'app/models/spree/gateway/worldpay.rb', line 39

def credit(money, authorization, options = {})
  refund(money, authorization, options)
end

#provider_classObject



15
16
17
# File 'app/models/spree/gateway/worldpay.rb', line 15

def provider_class
  ActiveMerchant::Billing::WorldpayGateway
end

#purchase(money, credit_card, options = {}) ⇒ Object



19
20
21
22
# File 'app/models/spree/gateway/worldpay.rb', line 19

def purchase(money, credit_card, options = {})
  provider = credit_card_provider(credit_card, options)
  provider.purchase(money, credit_card, options)
end

#refund(money, authorization, options = {}) ⇒ Object



34
35
36
37
# File 'app/models/spree/gateway/worldpay.rb', line 34

def refund(money, authorization, options = {})
  provider = credit_card_provider(auth_credit_card(authorization), options)
  provider.refund(money, authorization, options)
end

#void(authorization, options = {}) ⇒ Object



43
44
45
46
# File 'app/models/spree/gateway/worldpay.rb', line 43

def void(authorization, options = {})
  provider = credit_card_provider(auth_credit_card(authorization), options)
  provider.void(authorization, options)
end