Sha256: d6ef0c42e3f2396831316f9b483c467d9dbaf1eb46156b43e61a9044ebd76d02

Contents?: true

Size: 1.14 KB

Versions: 13

Compression:

Stored size: 1.14 KB

Contents

module Braintree
  module PaymentMethodParser

    def self.parse_payment_method(gateway, attributes)
      if attributes[:credit_card]
        CreditCard._new(gateway, attributes[:credit_card])
      elsif attributes[:paypal_account]
        PayPalAccount._new(gateway, attributes[:paypal_account])
      elsif attributes[:us_bank_account]
        UsBankAccount._new(gateway, attributes[:us_bank_account])
      elsif attributes[:apple_pay_card]
        ApplePayCard._new(gateway, attributes[:apple_pay_card])
      elsif attributes[:android_pay_card]
        GooglePayCard._new(gateway, attributes[:android_pay_card])
      elsif attributes[:venmo_account]
        VenmoAccount._new(gateway, attributes[:venmo_account])
      elsif attributes[:visa_checkout_card]
        VisaCheckoutCard._new(gateway, attributes[:visa_checkout_card])
      elsif attributes[:samsung_pay_card]
        SamsungPayCard._new(gateway, attributes[:samsung_pay_card])
      elsif attributes[:sepa_debit_account]
        SepaDirectDebitAccount._new(gateway, attributes[:sepa_debit_account])
      else
        UnknownPaymentMethod._new(gateway, attributes)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
braintree-4.22.0 lib/braintree/payment_method_parser.rb
braintree-4.21.0 lib/braintree/payment_method_parser.rb
braintree-4.20.0 lib/braintree/payment_method_parser.rb
braintree-4.19.0 lib/braintree/payment_method_parser.rb
braintree-4.18.0 lib/braintree/payment_method_parser.rb
braintree-4.17.0 lib/braintree/payment_method_parser.rb
braintree-4.16.0 lib/braintree/payment_method_parser.rb
braintree-4.15.0 lib/braintree/payment_method_parser.rb
braintree-4.14.0 lib/braintree/payment_method_parser.rb
braintree-4.13.0 lib/braintree/payment_method_parser.rb
braintree-4.12.0 lib/braintree/payment_method_parser.rb
braintree-4.11.0 lib/braintree/payment_method_parser.rb
braintree-4.10.0 lib/braintree/payment_method_parser.rb