Class: Balanced::BankAccount
- Inherits:
-
DebitableFundingInstrument
- Object
- FundingInstrument
- DebitableFundingInstrument
- Balanced::BankAccount
- Includes:
- HypermediaRegistry, Resource
- Defined in:
- lib/balanced/resources/bank_account.rb
Overview
A BankAccount is both a source, and a destination of, funds. You may create Debits and Credits to and from, this funding source.
NOTE: The BankAccount resource does not support creating a Hold.
Instance Attribute Summary
Attributes included from Resource
#attributes, #href, #hyperlinks, #id, #links
Instance Method Summary collapse
- #associate_to_customer(customer) ⇒ Object
-
#credit(options = {}) ⇒ Credit
Creates a Credit of funds from your Marketplace’s escrow account to this Account.
-
#debit(options = {}) ⇒ Debit
Creates a Debit of funds from this BankAccount to your Marketplace’s escrow account.
- #verify ⇒ Object
Methods included from HypermediaRegistry
Methods included from Resource
#copy_from, #does_resource_respond_to?, #fetch, #hydrate, included, #initialize, #method_missing, #reload, #respond_to?, #respond_to_missing?, #sanitize, #save, #unstore
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Balanced::Resource
Instance Method Details
#associate_to_customer(customer) ⇒ Object
38 39 40 41 |
# File 'lib/balanced/resources/bank_account.rb', line 38 def associate_to_customer(customer) self.links['customer'] = Balanced::Utils.extract_href_from_object(customer) save end |
#credit(options = {}) ⇒ Credit
Creates a Credit of funds from your Marketplace’s escrow account to this Account.
26 27 28 29 30 |
# File 'lib/balanced/resources/bank_account.rb', line 26 def credit( = {}) [:href] = self.credits.href credit = Balanced::Credit.new() credit.save end |
#debit(options = {}) ⇒ Debit
Creates a Debit of funds from this BankAccount to your Marketplace’s escrow account.
16 17 18 19 20 |
# File 'lib/balanced/resources/bank_account.rb', line 16 def debit( = {}) [:href] = self.debits.href debit = Balanced::Debit.new() debit.save end |
#verify ⇒ Object
32 33 34 35 36 |
# File 'lib/balanced/resources/bank_account.rb', line 32 def verify = {:href => self.bank_account_verifications.href} vf = BankAccountVerification.new() vf.save end |