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



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

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



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

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



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

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

#provider_classObject



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

def provider_class
  ActiveMerchant::Billing::WorldpayGateway
end

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



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

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



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

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

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



48
49
50
51
# File 'app/models/spree/gateway/worldpay.rb', line 48

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