Sha256: 532df815adb0d4fcd2b8b65b837c518a29f51360da92f4eee82359ffd2e1adda

Contents?: true

Size: 1.02 KB

Versions: 15

Compression:

Stored size: 1.02 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])
      else
        UnknownPaymentMethod._new(gateway, attributes)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
braintree-4.9.0 lib/braintree/payment_method_parser.rb
braintree-4.8.0 lib/braintree/payment_method_parser.rb
braintree-4.7.0 lib/braintree/payment_method_parser.rb
braintree-4.6.0 lib/braintree/payment_method_parser.rb
braintree-4.5.0 lib/braintree/payment_method_parser.rb
braintree-4.4.0 lib/braintree/payment_method_parser.rb
braintree-4.3.0 lib/braintree/payment_method_parser.rb
braintree-4.2.0 lib/braintree/payment_method_parser.rb
braintree-4.1.0 lib/braintree/payment_method_parser.rb
braintree-4.0.0 lib/braintree/payment_method_parser.rb
braintree-3.4.0 lib/braintree/payment_method_parser.rb
braintree-3.3.0 lib/braintree/payment_method_parser.rb
braintree-3.2.0 lib/braintree/payment_method_parser.rb
braintree-3.1.0 lib/braintree/payment_method_parser.rb
braintree-3.0.1 lib/braintree/payment_method_parser.rb