Class: Spree::Gateway::CheckoutV2Gateway

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

Instance Method Summary collapse

Instance Method Details

#authorize(money, creditcard, gateway_options) ⇒ Object



17
18
19
20
21
22
23
# File 'app/models/spree/gateway/checkout_v2_gateway.rb', line 17

def authorize(money, creditcard, gateway_options)
  if creditcard.number.blank? && creditcard.gateway_payment_profile_id.present?
    provider.authorize(money, creditcard.gateway_payment_profile_id, gateway_options)
  else
    provider.authorize(money, creditcard, gateway_options)
  end
end

#method_typeObject



9
10
11
# File 'app/models/spree/gateway/checkout_v2_gateway.rb', line 9

def method_type
  'checkout_v2'
end

#provider_classObject



13
14
15
# File 'app/models/spree/gateway/checkout_v2_gateway.rb', line 13

def provider_class
  ActiveMerchant::Billing::CheckoutV2
end

#purchase(money, creditcard, gateway_options) ⇒ Object



25
26
27
28
29
30
31
# File 'app/models/spree/gateway/checkout_v2_gateway.rb', line 25

def purchase(money, creditcard, gateway_options)
  if creditcard.number.blank? && creditcard.gateway_payment_profile_id.present?
    provider.purchase(money, creditcard.gateway_payment_profile_id, gateway_options)
  else
    provider.purchase(money, creditcard, gateway_options)
  end
end