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](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](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 ID of the account that the bank account is associated with.
-
#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`, or `errored`.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .delete(id, params = {}, opts = {}) ⇒ Object
- .list(filters = {}, 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
#==, #[], #[]=, 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 ID of the account that the bank account is associated with.
36 37 38 |
# File 'lib/stripe/resources/bank_account.rb', line 36 def account @account end |
#account_holder_name ⇒ Object (readonly)
The name of the person or business that owns the bank account.
38 39 40 |
# File 'lib/stripe/resources/bank_account.rb', line 38 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`.
40 41 42 |
# File 'lib/stripe/resources/bank_account.rb', line 40 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`.
42 43 44 |
# File 'lib/stripe/resources/bank_account.rb', line 42 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.
44 45 46 |
# File 'lib/stripe/resources/bank_account.rb', line 44 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`).
46 47 48 |
# File 'lib/stripe/resources/bank_account.rb', line 46 def bank_name @bank_name end |
#country ⇒ Object (readonly)
Two-letter ISO code representing the country the bank account is located in.
48 49 50 |
# File 'lib/stripe/resources/bank_account.rb', line 48 def country @country end |
#currency ⇒ Object (readonly)
Three-letter [ISO code for the currency](stripe.com/docs/payouts) paid out to the bank account.
50 51 52 |
# File 'lib/stripe/resources/bank_account.rb', line 50 def currency @currency end |
#customer ⇒ Object (readonly)
The ID of the customer that the bank account is associated with.
52 53 54 |
# File 'lib/stripe/resources/bank_account.rb', line 52 def customer @customer end |
#default_for_currency ⇒ Object (readonly)
Whether this bank account is the default external account for its currency.
54 55 56 |
# File 'lib/stripe/resources/bank_account.rb', line 54 def default_for_currency @default_for_currency end |
#deleted ⇒ Object (readonly)
Always true for a deleted object
76 77 78 |
# File 'lib/stripe/resources/bank_account.rb', line 76 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.
56 57 58 |
# File 'lib/stripe/resources/bank_account.rb', line 56 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.
58 59 60 |
# File 'lib/stripe/resources/bank_account.rb', line 58 def future_requirements @future_requirements end |
#id ⇒ Object (readonly)
Unique identifier for the object.
60 61 62 |
# File 'lib/stripe/resources/bank_account.rb', line 60 def id @id end |
#last4 ⇒ Object (readonly)
The last four digits of the bank account number.
62 63 64 |
# File 'lib/stripe/resources/bank_account.rb', line 62 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.
64 65 66 |
# File 'lib/stripe/resources/bank_account.rb', line 64 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
66 67 68 |
# File 'lib/stripe/resources/bank_account.rb', line 66 def object @object end |
#requirements ⇒ Object (readonly)
Information about the requirements for the bank account, including what information needs to be collected.
68 69 70 |
# File 'lib/stripe/resources/bank_account.rb', line 68 def requirements @requirements end |
#routing_number ⇒ Object (readonly)
The routing transit number for the bank account.
70 71 72 |
# File 'lib/stripe/resources/bank_account.rb', line 70 def routing_number @routing_number end |
#status ⇒ Object (readonly)
For bank accounts, possible values are ‘new`, `validated`, `verified`, `verification_failed`, 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 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` and `verification_failed`. 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.
74 75 76 |
# File 'lib/stripe/resources/bank_account.rb', line 74 def status @status end |
Class Method Details
.delete(id, params = {}, opts = {}) ⇒ Object
124 125 126 127 128 129 130 131 |
# File 'lib/stripe/resources/bank_account.rb', line 124 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 |
.list(filters = {}, opts = {}) ⇒ Object
142 143 144 145 146 147 148 |
# File 'lib/stripe/resources/bank_account.rb', line 142 def self.list(filters = {}, 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
115 116 117 118 119 120 121 122 |
# File 'lib/stripe/resources/bank_account.rb', line 115 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
106 107 108 109 110 111 112 113 |
# File 'lib/stripe/resources/bank_account.rb', line 106 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
87 88 89 90 91 92 93 94 |
# File 'lib/stripe/resources/bank_account.rb', line 87 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
133 134 135 136 137 138 139 140 |
# File 'lib/stripe/resources/bank_account.rb', line 133 def delete(params = {}, opts = {}) request_stripe_object( method: :delete, path: resource_url.to_s, params: params, opts: opts ) end |
#resource_url ⇒ Object
96 97 98 99 100 101 102 103 104 |
# File 'lib/stripe/resources/bank_account.rb', line 96 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
78 79 80 81 82 83 84 85 |
# File 'lib/stripe/resources/bank_account.rb', line 78 def verify(params = {}, opts = {}) request_stripe_object( method: :post, path: "#{Customer.resource_url}/#{customer}/sources/#{id}/verify", params: params, opts: opts ) end |