Class: Braintree::UsBankAccount
- Inherits:
-
Object
- Object
- Braintree::UsBankAccount
- Includes:
- BaseModule
- Defined in:
- lib/braintree/us_bank_account.rb
Instance Attribute Summary collapse
-
#account_holder_name ⇒ Object
readonly
Returns the value of attribute account_holder_name.
-
#account_type ⇒ Object
readonly
Returns the value of attribute account_type.
-
#ach_mandate ⇒ Object
readonly
Returns the value of attribute ach_mandate.
-
#bank_name ⇒ Object
readonly
Returns the value of attribute bank_name.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#last_4 ⇒ Object
readonly
Returns the value of attribute last_4.
-
#routing_number ⇒ Object
readonly
Returns the value of attribute routing_number.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#verifications ⇒ Object
readonly
Returns the value of attribute verifications.
-
#verified ⇒ Object
readonly
Returns the value of attribute verified.
Class Method Summary collapse
- ._new(*args) ⇒ Object
- .find(*args) ⇒ Object
- .sale(token, transaction_attributes) ⇒ Object
- .sale!(token, transaction_attributes) ⇒ Object
Instance Method Summary collapse
- #default? ⇒ Boolean
-
#initialize(gateway, attributes) ⇒ UsBankAccount
constructor
A new instance of UsBankAccount.
Methods included from BaseModule
Methods included from BaseModule::Methods
#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class
Constructor Details
#initialize(gateway, attributes) ⇒ UsBankAccount
Returns a new instance of UsBankAccount.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/braintree/us_bank_account.rb', line 17 def initialize(gateway, attributes) @gateway = gateway set_instance_variables_from_hash(attributes) @ach_mandate = AchMandate.new(attributes[:ach_mandate]) if attributes[:ach_mandate] if attributes[:verifications] @verifications = attributes[:verifications].map do |v| UsBankAccountVerification._new(v) end end end |
Instance Attribute Details
#account_holder_name ⇒ Object (readonly)
Returns the value of attribute account_holder_name.
5 6 7 |
# File 'lib/braintree/us_bank_account.rb', line 5 def account_holder_name @account_holder_name end |
#account_type ⇒ Object (readonly)
Returns the value of attribute account_type.
6 7 8 |
# File 'lib/braintree/us_bank_account.rb', line 6 def account_type @account_type end |
#ach_mandate ⇒ Object (readonly)
Returns the value of attribute ach_mandate.
7 8 9 |
# File 'lib/braintree/us_bank_account.rb', line 7 def ach_mandate @ach_mandate end |
#bank_name ⇒ Object (readonly)
Returns the value of attribute bank_name.
8 9 10 |
# File 'lib/braintree/us_bank_account.rb', line 8 def bank_name @bank_name end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
9 10 11 |
# File 'lib/braintree/us_bank_account.rb', line 9 def default @default end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
10 11 12 |
# File 'lib/braintree/us_bank_account.rb', line 10 def image_url @image_url end |
#last_4 ⇒ Object (readonly)
Returns the value of attribute last_4.
11 12 13 |
# File 'lib/braintree/us_bank_account.rb', line 11 def last_4 @last_4 end |
#routing_number ⇒ Object (readonly)
Returns the value of attribute routing_number.
12 13 14 |
# File 'lib/braintree/us_bank_account.rb', line 12 def routing_number @routing_number end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
13 14 15 |
# File 'lib/braintree/us_bank_account.rb', line 13 def token @token end |
#verifications ⇒ Object (readonly)
Returns the value of attribute verifications.
14 15 16 |
# File 'lib/braintree/us_bank_account.rb', line 14 def verifications @verifications end |
#verified ⇒ Object (readonly)
Returns the value of attribute verified.
15 16 17 |
# File 'lib/braintree/us_bank_account.rb', line 15 def verified @verified end |
Class Method Details
._new(*args) ⇒ Object
37 38 39 |
# File 'lib/braintree/us_bank_account.rb', line 37 def self._new(*args) self.new(*args) end |
.find(*args) ⇒ Object
41 42 43 |
# File 'lib/braintree/us_bank_account.rb', line 41 def self.find(*args) Configuration.gateway.us_bank_account.find(*args) end |
.sale(token, transaction_attributes) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/braintree/us_bank_account.rb', line 45 def self.sale(token, transaction_attributes) Configuration.gateway.transaction.sale(transaction_attributes.merge( :payment_method_token => token, :options => {:submit_for_settlement => true}, ), ) end |
.sale!(token, transaction_attributes) ⇒ Object
53 54 55 |
# File 'lib/braintree/us_bank_account.rb', line 53 def self.sale!(token, transaction_attributes) return_object_or_raise(:transaction) { sale(token, transaction_attributes) } end |
Instance Method Details
#default? ⇒ Boolean
29 30 31 |
# File 'lib/braintree/us_bank_account.rb', line 29 def default? @default end |