Class: Stripe::BankAccount
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::BankAccount
- Extended by:
- APIOperations::List
- Includes:
- APIOperations::Delete, APIOperations::Save
- Defined in:
- lib/stripe/resources/bank_account.rb
Overview
These bank accounts are payment methods on ‘Customer` objects.
On the other hand [External Accounts](docs.stripe.com/api#external_accounts) are transfer destinations on ‘Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above.
Related guide: [Bank debits and transfers](docs.stripe.com/payments/bank-debits-transfers)
Defined Under Namespace
Classes: FutureRequirements, Requirements
Constant Summary collapse
- OBJECT_NAME =
"bank_account"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
The account this bank account belongs to.
-
#account_holder_name ⇒ Object
readonly
The name of the person or business that owns the bank account.
-
#account_holder_type ⇒ Object
readonly
The type of entity that holds the account.
-
#account_type ⇒ Object
readonly
The bank account type.
-
#available_payout_methods ⇒ Object
readonly
A set of available payout methods for this bank account.
-
#bank_name ⇒ Object
readonly
Name of the bank associated with the routing number (e.g., ‘WELLS FARGO`).
-
#country ⇒ Object
readonly
Two-letter ISO code representing the country the bank account is located in.
-
#currency ⇒ Object
readonly
Three-letter [ISO code for the currency](stripe.com/docs/payouts) paid out to the bank account.
-
#customer ⇒ Object
readonly
The ID of the customer that the bank account is associated with.
-
#default_for_currency ⇒ Object
readonly
Whether this bank account is the default external account for its currency.
-
#deleted ⇒ Object
readonly
Always true for a deleted object.
-
#fingerprint ⇒ Object
readonly
Uniquely identifies this particular bank account.
-
#future_requirements ⇒ Object
readonly
Information about the [upcoming new requirements for the bank account](stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#last4 ⇒ Object
readonly
The last four digits of the bank account number.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#requirements ⇒ Object
readonly
Information about the requirements for the bank account, including what information needs to be collected.
-
#routing_number ⇒ Object
readonly
The routing transit number for the bank account.
-
#status ⇒ Object
readonly
For bank accounts, possible values are ‘new`, `validated`, `verified`, `verification_failed`, `tokenized_account_number_deactivated` or `errored`.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .delete(id, params = {}, opts = {}) ⇒ Object
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
- .list(params = {}, opts = {}) ⇒ Object
- .object_name ⇒ Object
- .retrieve(_id, _opts = nil) ⇒ Object
- .update(_id, _params = nil, _opts = nil) ⇒ Object
- .verify(customer, id, params = {}, opts = {}) ⇒ Object
Instance Method Summary collapse
- #delete(params = {}, opts = {}) ⇒ Object
- #resource_url ⇒ Object
- #verify(params = {}, opts = {}) ⇒ Object
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods included from APIOperations::Delete
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#account ⇒ Object (readonly)
The account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an [External Account](/api/external_account_bank_accounts/object) where [controller.is_controller](/api/accounts/object#account_object-controller-is_controller) is ‘true`.
92 93 94 |
# File 'lib/stripe/resources/bank_account.rb', line 92 def account @account end |
#account_holder_name ⇒ Object (readonly)
The name of the person or business that owns the bank account.
94 95 96 |
# File 'lib/stripe/resources/bank_account.rb', line 94 def account_holder_name @account_holder_name end |
#account_holder_type ⇒ Object (readonly)
The type of entity that holds the account. This can be either ‘individual` or `company`.
96 97 98 |
# File 'lib/stripe/resources/bank_account.rb', line 96 def account_holder_type @account_holder_type end |
#account_type ⇒ Object (readonly)
The bank account type. This can only be ‘checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.
98 99 100 |
# File 'lib/stripe/resources/bank_account.rb', line 98 def account_type @account_type end |
#available_payout_methods ⇒ Object (readonly)
A set of available payout methods for this bank account. Only values from this set should be passed as the ‘method` when creating a payout.
100 101 102 |
# File 'lib/stripe/resources/bank_account.rb', line 100 def available_payout_methods @available_payout_methods end |
#bank_name ⇒ Object (readonly)
Name of the bank associated with the routing number (e.g., ‘WELLS FARGO`).
102 103 104 |
# File 'lib/stripe/resources/bank_account.rb', line 102 def bank_name @bank_name end |
#country ⇒ Object (readonly)
Two-letter ISO code representing the country the bank account is located in.
104 105 106 |
# File 'lib/stripe/resources/bank_account.rb', line 104 def country @country end |
#currency ⇒ Object (readonly)
Three-letter [ISO code for the currency](stripe.com/docs/payouts) paid out to the bank account.
106 107 108 |
# File 'lib/stripe/resources/bank_account.rb', line 106 def currency @currency end |
#customer ⇒ Object (readonly)
The ID of the customer that the bank account is associated with.
108 109 110 |
# File 'lib/stripe/resources/bank_account.rb', line 108 def customer @customer end |
#default_for_currency ⇒ Object (readonly)
Whether this bank account is the default external account for its currency.
110 111 112 |
# File 'lib/stripe/resources/bank_account.rb', line 110 def default_for_currency @default_for_currency end |
#deleted ⇒ Object (readonly)
Always true for a deleted object
132 133 134 |
# File 'lib/stripe/resources/bank_account.rb', line 132 def deleted @deleted end |
#fingerprint ⇒ Object (readonly)
Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
112 113 114 |
# File 'lib/stripe/resources/bank_account.rb', line 112 def fingerprint @fingerprint end |
#future_requirements ⇒ Object (readonly)
Information about the [upcoming new requirements for the bank account](stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
114 115 116 |
# File 'lib/stripe/resources/bank_account.rb', line 114 def future_requirements @future_requirements end |
#id ⇒ Object (readonly)
Unique identifier for the object.
116 117 118 |
# File 'lib/stripe/resources/bank_account.rb', line 116 def id @id end |
#last4 ⇒ Object (readonly)
The last four digits of the bank account number.
118 119 120 |
# File 'lib/stripe/resources/bank_account.rb', line 118 def last4 @last4 end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
120 121 122 |
# File 'lib/stripe/resources/bank_account.rb', line 120 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
122 123 124 |
# File 'lib/stripe/resources/bank_account.rb', line 122 def object @object end |
#requirements ⇒ Object (readonly)
Information about the requirements for the bank account, including what information needs to be collected.
124 125 126 |
# File 'lib/stripe/resources/bank_account.rb', line 124 def requirements @requirements end |
#routing_number ⇒ Object (readonly)
The routing transit number for the bank account.
126 127 128 |
# File 'lib/stripe/resources/bank_account.rb', line 126 def routing_number @routing_number end |
#status ⇒ Object (readonly)
For bank accounts, possible values are ‘new`, `validated`, `verified`, `verification_failed`, `tokenized_account_number_deactivated` or `errored`. A bank account that hasn’t had any activity or validation performed is ‘new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If the status is `tokenized_account_number_deactivated`, the account utilizes a tokenized account number which has been deactivated due to expiration or revocation. This account will need to be reverified to continue using it for money movement. If a payout sent to this bank account fails, we’ll set the status to ‘errored` and will not continue to send [scheduled payouts](stripe.com/docs/payouts#payout-schedule) until the bank details are updated.
For external accounts, possible values are ‘new`, `errored`, `verification_failed`, and `tokenized_account_number_deactivated`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can’t [verify the owner of the bank account](support.stripe.com/questions/bank-account-ownership-verification), we’ll set the status to ‘verification_failed`. Other validations aren’t run against external accounts because they’re only used for payouts. This means the other statuses don’t apply.
130 131 132 |
# File 'lib/stripe/resources/bank_account.rb', line 130 def status @status end |
Class Method Details
.delete(id, params = {}, opts = {}) ⇒ Object
180 181 182 183 184 185 186 187 |
# File 'lib/stripe/resources/bank_account.rb', line 180 def self.delete(id, params = {}, opts = {}) raise NotImplementedError, "Bank accounts cannot be deleted without a customer ID or an " \ "account ID. Delete a bank account using " \ "`Customer.delete_source('customer_id', 'bank_account_id')` " \ "or `Account.delete_external_account('account_id', " \ "'bank_account_id')`" end |
.field_remappings ⇒ Object
210 211 212 |
# File 'lib/stripe/resources/bank_account.rb', line 210 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
206 207 208 |
# File 'lib/stripe/resources/bank_account.rb', line 206 def self.inner_class_types @inner_class_types = { future_requirements: FutureRequirements, requirements: Requirements } end |
.list(params = {}, opts = {}) ⇒ Object
198 199 200 201 202 203 204 |
# File 'lib/stripe/resources/bank_account.rb', line 198 def self.list(params = {}, opts = {}) raise NotImplementedError, "Bank accounts cannot be listed without a customer ID or an " \ "account ID. List bank accounts using " \ "`Customer.list_sources('customer_id')` " \ "or `Account.list_external_accounts('account_id')`" end |
.object_name ⇒ Object
18 19 20 |
# File 'lib/stripe/resources/bank_account.rb', line 18 def self.object_name "bank_account" end |
.retrieve(_id, _opts = nil) ⇒ Object
171 172 173 174 175 176 177 178 |
# File 'lib/stripe/resources/bank_account.rb', line 171 def self.retrieve(_id, _opts = nil) raise NotImplementedError, "Bank accounts cannot be retrieve without a customer ID or an " \ "account ID. Retrieve a bank account using " \ "`Customer.retrieve_source('customer_id', 'bank_account_id')` " \ "or `Account.retrieve_external_account('account_id', " \ "'bank_account_id')`" end |
.update(_id, _params = nil, _opts = nil) ⇒ Object
162 163 164 165 166 167 168 169 |
# File 'lib/stripe/resources/bank_account.rb', line 162 def self.update(_id, _params = nil, _opts = nil) raise NotImplementedError, "Bank accounts cannot be updated without a customer ID or an " \ "account ID. Update a bank account using " \ "`Customer.update_source('customer_id', 'bank_account_id', " \ "update_params)` or `Account.update_external_account(" \ "'account_id', 'bank_account_id', update_params)`" end |
.verify(customer, id, params = {}, opts = {}) ⇒ Object
143 144 145 146 147 148 149 150 |
# File 'lib/stripe/resources/bank_account.rb', line 143 def self.verify(customer, id, params = {}, opts = {}) request_stripe_object( method: :post, path: "#{Customer.resource_url}/#{customer}/sources/#{id}/verify", params: params, opts: opts ) end |
Instance Method Details
#delete(params = {}, opts = {}) ⇒ Object
189 190 191 192 193 194 195 196 |
# File 'lib/stripe/resources/bank_account.rb', line 189 def delete(params = {}, opts = {}) request_stripe_object( method: :delete, path: resource_url.to_s, params: params, opts: opts ) end |
#resource_url ⇒ Object
152 153 154 155 156 157 158 159 160 |
# File 'lib/stripe/resources/bank_account.rb', line 152 def resource_url if !customer.nil? "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}" elsif !account.nil? "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}" else raise InvalidRequestError, "Could not determine which URL to request: [account, customer] fields are all null" end end |
#verify(params = {}, opts = {}) ⇒ Object
134 135 136 137 138 139 140 141 |
# File 'lib/stripe/resources/bank_account.rb', line 134 def verify(params = {}, opts = {}) request_stripe_object( method: :post, path: "#{Customer.resource_url}/#{customer}/sources/#{id}/verify", params: params, opts: opts ) end |