Class: Braintree::UsBankAccount

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/us_bank_account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

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_nameObject (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
end

#account_typeObject (readonly)

Returns the value of attribute account_type.



6
7
8
# File 'lib/braintree/us_bank_account.rb', line 6

def 
  @account_type
end

#ach_mandateObject (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_nameObject (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

#defaultObject (readonly)

Returns the value of attribute default.



9
10
11
# File 'lib/braintree/us_bank_account.rb', line 9

def default
  @default
end

#image_urlObject (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_4Object (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_numberObject (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

#tokenObject (readonly)

Returns the value of attribute token.



13
14
15
# File 'lib/braintree/us_bank_account.rb', line 13

def token
  @token
end

#verificationsObject (readonly)

Returns the value of attribute verifications.



14
15
16
# File 'lib/braintree/us_bank_account.rb', line 14

def verifications
  @verifications
end

#verifiedObject (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..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

Returns:

  • (Boolean)


29
30
31
# File 'lib/braintree/us_bank_account.rb', line 29

def default?
  @default
end