mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-15 00:00:44 -04:00
20 lines
656 B
Ruby
20 lines
656 B
Ruby
module Stripe
|
|
class BankAccount < APIResource
|
|
include Stripe::APIOperations::Update
|
|
include Stripe::APIOperations::Delete
|
|
include Stripe::APIOperations::List
|
|
|
|
def url
|
|
if respond_to?(:customer)
|
|
"#{Customer.url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
|
|
elsif respond_to?(:account)
|
|
"#{Account.url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
|
|
end
|
|
end
|
|
|
|
def self.retrieve(id, opts=nil)
|
|
raise NotImplementedError.new("Bank accounts cannot be retrieved without an account ID. Retrieve a bank account using account.external_accounts.retrieve('card_id')")
|
|
end
|
|
end
|
|
end
|