Module: Workarea::Payment::AfterpayPaymentGateway

Included in:
Workarea::Payment::Authorize::Afterpay, Capture::Afterpay, Purchase::Afterpay
Defined in:
app/models/workarea/payment/afterpay_payment_gateway.rb

Instance Method Summary collapse

Instance Method Details

#gatewayObject

Examines the tenders currency and selects the correct credentials to use in the gateway

Returns:

  • Workarea::Afterpay::Gateway



8
9
10
11
12
13
# File 'app/models/workarea/payment/afterpay_payment_gateway.rb', line 8

def gateway
  currency = tender.amount.currency.iso_code
  location = Afterpay.config[:currency_country_map][currency.to_sym]

  Afterpay.gateway(location.to_sym.downcase)
end