Class: Braintree::UsBankAccountGateway

Inherits:
Object
  • Object
show all
Defined in:
lib/braintree/us_bank_account_gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(gateway) ⇒ UsBankAccountGateway

Returns a new instance of UsBankAccountGateway.


3
4
5
6
7
# File 'lib/braintree/us_bank_account_gateway.rb', line 3

def initialize(gateway)
  @gateway = gateway
  @config = gateway.config
  @config.assert_has_access_token_or_keys
end

Instance Method Details

#find(token) ⇒ Object


9
10
11
12
13
14
15
# File 'lib/braintree/us_bank_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/us_bank_account/#{token}")
  UsBankAccount._new(@gateway, response[:us_bank_account])
rescue NotFoundError
  raise NotFoundError, "payment method with token #{token.inspect} not found"
end