mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-05 00:02:50 -04:00
25 lines
806 B
Ruby
25 lines
806 B
Ruby
module Stripe
|
|
class BankAccount < APIResource
|
|
include Stripe::APIOperations::Update
|
|
include Stripe::APIOperations::Delete
|
|
extend Stripe::APIOperations::List
|
|
|
|
def verify(params={}, opts={})
|
|
response, opts = request(:post, url + '/verify', params, opts)
|
|
initialize_from(response, opts)
|
|
end
|
|
|
|
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
|