Sha256: fc1bab6088c4dd3cf65694f743ced71a650d786404b48d01b78fd51caa0998d6

Contents?: true

Size: 1.37 KB

Versions: 10

Compression:

Stored size: 1.37 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[:coinbase_account]
        CoinbaseAccount._new(gateway, attributes[:coinbase_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]
        AndroidPayCard._new(gateway, attributes[:android_pay_card])
      elsif attributes[:amex_express_checkout_card]
        AmexExpressCheckoutCard._new(gateway, attributes[:amex_express_checkout_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[:masterpass_card]
        MasterpassCard._new(gateway, attributes[:masterpass_card])
      elsif attributes[:samsung_pay_card]
        SamsungPayCard._new(gateway, attributes[:samsung_pay_card])
      else
        UnknownPaymentMethod._new(gateway, attributes)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
braintree-2.103.0 lib/braintree/payment_method_parser.rb
braintree-2.102.0 lib/braintree/payment_method_parser.rb
braintree-2.101.0 lib/braintree/payment_method_parser.rb
braintree-2.100.0 lib/braintree/payment_method_parser.rb
braintree-2.99.0 lib/braintree/payment_method_parser.rb
braintree-2.98.0 lib/braintree/payment_method_parser.rb
braintree-2.97.0 lib/braintree/payment_method_parser.rb
braintree-2.96.0 lib/braintree/payment_method_parser.rb
braintree-2.95.0 lib/braintree/payment_method_parser.rb
braintree-2.94.0 lib/braintree/payment_method_parser.rb