Static methods for delete/list on BankAccount/Card cannot be implemented. Use the onces on Customer instead. (#1420)

This commit is contained in:
Ramya Rao 2024-06-27 14:17:28 -07:00 committed by GitHub
parent f0c40e0f79
commit fa2baeba7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 24 deletions

View File

@ -64,12 +64,12 @@ module Stripe
end
def self.delete(id, params = {}, opts = {})
request_stripe_object(
method: :delete,
path: "#{resource_url}/#{id}",
params: params,
opts: 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
def delete(params = {}, opts = {})
@ -82,12 +82,11 @@ module Stripe
end
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :delete,
path: resource_url.to_s,
params: filters,
opts: 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
end
end

View File

@ -42,12 +42,11 @@ module Stripe
end
def self.delete(id, params = {}, opts = {})
request_stripe_object(
method: :delete,
path: "#{resource_url}/#{id}",
params: params,
opts: opts
)
raise NotImplementedError,
"Card cannot be deleted without a customer ID or an account " \
"ID. Delete a card using `Customer.delete_source(" \
"'customer_id', 'card_id')` or " \
"`Account.delete_external_account('account_id', 'card_id')`"
end
def delete(params = {}, opts = {})
@ -60,12 +59,11 @@ module Stripe
end
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :delete,
path: resource_url.to_s,
params: filters,
opts: opts
)
raise NotImplementedError,
"Cards cannot be listed without a customer ID or an account " \
"ID. List cards using `Customer.list_sources(" \
"'customer_id')` or " \
"`Account.list_external_accounts('account_id')`"
end
end
end