Class: Stripe::BankAccount
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)
Constant Summary
collapse
- OBJECT_NAME =
"bank_account"
Constants inherited
from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from APIResource
#save_with_parent
Attributes inherited from StripeObject
#last_response
Class Method Summary
collapse
Instance Method Summary
collapse
list
included, #save
included
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, save_nested_resource
included
#==, #[], #[]=, 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
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Stripe::StripeObject
Class Method Details
.delete(id, params = {}, opts = {}) ⇒ Object
66
67
68
69
70
71
72
73
|
# File 'lib/stripe/resources/bank_account.rb', line 66
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(params = {}, opts = {}) ⇒ Object
84
85
86
87
88
89
90
|
# File 'lib/stripe/resources/bank_account.rb', line 84
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
57
58
59
60
61
62
63
64
|
# File 'lib/stripe/resources/bank_account.rb', line 57
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
48
49
50
51
52
53
54
55
|
# File 'lib/stripe/resources/bank_account.rb', line 48
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
31
32
33
34
35
36
37
38
|
# File 'lib/stripe/resources/bank_account.rb', line 31
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
75
76
77
78
79
80
81
82
|
# File 'lib/stripe/resources/bank_account.rb', line 75
def delete(params = {}, opts = {})
request_stripe_object(
method: :delete,
path: resource_url.to_s,
params: params,
opts: opts
)
end
|
#resource_url ⇒ Object
40
41
42
43
44
45
46
|
# File 'lib/stripe/resources/bank_account.rb', line 40
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
22
23
24
25
26
27
28
29
|
# File 'lib/stripe/resources/bank_account.rb', line 22
def verify(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "#{Customer.resource_url}/#{customer}/sources/#{id}/verify",
params: params,
opts: opts
)
end
|