Skip to content

Instantly share code, notes, and snippets.

@mahmoudimus
Forked from gbelote/code_extract.rb
Last active December 16, 2015 08:39
Show Gist options
  • Save mahmoudimus/5406880 to your computer and use it in GitHub Desktop.
Save mahmoudimus/5406880 to your computer and use it in GitHub Desktop.
balanced_bank_uri = "..." # stored when bank account created. this has also been verified.
account = Balanced::Marketplace.my_marketplace.create_account
account.add_bank_account(balanced_bank_uri)
debit = account.debit( appears_on_statement_as: "Test Balanced Debit", amount: 1, description: "This is a test debit in the console!" )
# What do I store in my database, you might be asking? Well!
# 1. the account uri => map that to a user on your system
# 2. for any transaction coming INTO your system (via debiting bank account / charging a card etc) => store the debit uri with that txn in your system
# 3. for any transaction LEAVING your system (via ach credit / depositing to a bank account ) => store the credit uri with that txn in your system
NoMethodError: undefined method `debit' for nil:NilClass
from /Users/gbelote/.rvm/gems/ruby-1.9.3-p194@wefunder/bundler/gems/balanced-ruby-3a9c66ae89b2/lib/balanced/resources/bank_account.rb:43:in `debit'
from (irb):3
... (snip: more stack trace from "rails c") ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment