Sha256: 86bd1d7c311eb73ac74b2b077cd68c7d23be2248bd3d2f452a180220f471a812

Contents?: true

Size: 446 Bytes

Versions: 4

Compression:

Stored size: 446 Bytes

Contents

module Workarea
  class Payment
    module AfterpayPaymentGateway
      # Examines the tenders currency and selects the
      # correct credentials to use in the gateway
      #
      # @return Workarea::Afterpay::Gateway
      def gateway
        currency = tender.amount.currency.iso_code
        location = Afterpay.config[:currency_country_map][currency.to_sym]

        Afterpay.gateway(location.to_sym.downcase)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
workarea-afterpay-2.1.2 app/models/workarea/payment/afterpay_payment_gateway.rb
workarea-afterpay-2.1.1 app/models/workarea/payment/afterpay_payment_gateway.rb
workarea-afterpay-2.1.0 app/models/workarea/payment/afterpay_payment_gateway.rb
workarea-afterpay-2.0.2 app/models/workarea/payment/afterpay_payment_gateway.rb