lib/braintree/customer.rb in braintree-2.54.0 vs lib/braintree/customer.rb in braintree-2.55.0
- old
+ new
@@ -2,11 +2,11 @@
class Customer
include BaseModule
attr_reader :addresses, :company, :created_at, :credit_cards, :email, :fax, :first_name, :id, :last_name,
:phone, :updated_at, :website, :custom_fields, :paypal_accounts, :apple_pay_cards, :coinbase_accounts,
- :android_pay_cards, :amex_express_checkout_cards
+ :android_pay_cards, :amex_express_checkout_cards, :venmo_accounts
def self.all
Configuration.gateway.customer.all
end
@@ -91,10 +91,11 @@
@coinbase_accounts = (@coinbase_accounts || []).map { |pm| CoinbaseAccount._new gateway, pm }
@apple_pay_cards = (@apple_pay_cards || []).map { |pm| ApplePayCard._new gateway, pm }
@europe_bank_accounts = (@europe_bank_Accounts || []).map { |pm| EuropeBankAccount._new gateway, pm }
@android_pay_cards = (@android_pay_cards || []).map { |pm| AndroidPayCard._new gateway, pm }
@amex_express_checkout_cards = (@amex_express_checkout_cards || []).map { |pm| AmexExpressCheckoutCard._new gateway, pm }
+ @venmo_accounts = (@venmo_accounts || []).map { |pm| VenmoAccount._new gateway, pm }
@addresses = (@addresses || []).map { |addr| Address._new gateway, addr }
@custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
end
def credit(transaction_attributes)
@@ -122,10 +123,16 @@
@gateway.customer.delete(id)
end
# Returns the customer's payment methods
def payment_methods
- @credit_cards.dup + @paypal_accounts.dup + @apple_pay_cards.dup + @coinbase_accounts.dup + @android_pay_cards.dup + @amex_express_checkout_cards.dup
+ @credit_cards +
+ @paypal_accounts.dup +
+ @apple_pay_cards.dup +
+ @coinbase_accounts.dup +
+ @android_pay_cards.dup +
+ @amex_express_checkout_cards.dup +
+ @venmo_accounts.dup
end
def inspect # :nodoc:
first = [:id]
last = [:addresses, :credit_cards, :paypal_accounts]