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/docs/api#external_accounts) are transfer destinations on ‘Account` objects for [Custom accounts](stripe.com/docs/connect/custom-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/docs/payments/bank-debits-transfers)
Constant Summary collapse
- OBJECT_NAME =
"bank_account"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
Instance Method Summary collapse
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
Class Method Details
.retrieve(_id, _opts = nil) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/stripe/resources/bank_account.rb', line 41 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
32 33 34 35 36 37 38 39 |
# File 'lib/stripe/resources/bank_account.rb', line 32 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 |
Instance Method Details
#resource_url ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/stripe/resources/bank_account.rb', line 24 def resource_url if respond_to?(:customer) "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}" elsif respond_to?(:account) "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}" end end |
#verify(params = {}, opts = {}) ⇒ Object
19 20 21 22 |
# File 'lib/stripe/resources/bank_account.rb', line 19 def verify(params = {}, opts = {}) resp, opts = execute_resource_request(:post, resource_url + "/verify", params, opts) initialize_from(resp.data, opts) end |