class Braintree::PayPalAccountGateway
Public Class Methods
new(gateway)
click to toggle source
# File lib/braintree/paypal_account_gateway.rb, line 3 def initialize(gateway) @gateway = gateway @config = gateway.config @config.assert_has_access_token_or_keys end
Public Instance Methods
create(attributes)
click to toggle source
# File lib/braintree/paypal_account_gateway.rb, line 17 def create(attributes) Util.verify_keys(PayPalAccountGateway._create_signature, attributes) _do_create("/payment_methods", :paypal_account => attributes) end
delete(token)
click to toggle source
# File lib/braintree/paypal_account_gateway.rb, line 27 def delete(token) @config.http.delete("#{@config.base_merchant_path}/payment_methods/paypal_account/#{token}") end
find(token)
click to toggle source
# File lib/braintree/paypal_account_gateway.rb, line 9 def find(token) raise ArgumentError if token.nil? || token.to_s.strip == "" response = @config.http.get("#{@config.base_merchant_path}/payment_methods/paypal_account/#{token}") PayPalAccount._new(@gateway, response[:paypal_account]) rescue NotFoundError raise NotFoundError, "payment method with token #{token.inspect} not found" end
update(token, attributes)
click to toggle source
# File lib/braintree/paypal_account_gateway.rb, line 22 def update(token, attributes) Util.verify_keys(PayPalAccountGateway._update_signature, attributes) _do_update(:put, "/payment_methods/paypal_account/#{token}", :paypal_account => attributes) end