diff --git a/lib/stripe/resources/bank_account.rb b/lib/stripe/resources/bank_account.rb index 36e85bfb4..5f4c17a25 100644 --- a/lib/stripe/resources/bank_account.rb +++ b/lib/stripe/resources/bank_account.rb @@ -64,12 +64,12 @@ def self.retrieve(_id, _opts = nil) 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 @@ def delete(params = {}, opts = {}) 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 diff --git a/lib/stripe/resources/card.rb b/lib/stripe/resources/card.rb index 1ef141ede..5f9f3c160 100644 --- a/lib/stripe/resources/card.rb +++ b/lib/stripe/resources/card.rb @@ -42,12 +42,11 @@ def self.retrieve(_id, _opts = nil) 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 @@ def delete(params = {}, opts = {}) 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