Skip to content

Instantly share code, notes, and snippets.

@mjallday
Created September 18, 2012 17:18
Show Gist options
  • Save mjallday/3744411 to your computer and use it in GitHub Desktop.
Save mjallday/3744411 to your computer and use it in GitHub Desktop.
Appears on statement as for credit
require 'balanced'
key = Balanced::ApiKey.new.save
Balanced.configure(key.secret)
Balanced::Marketplace.new.save
card = Balanced::Card.new(
:card_number => "5105105105105100",
:expiration_month => "12",
:expiration_year => "2015",
).save
buyer = Balanced::Marketplace.my_marketplace.create_buyer("buyer@example.org",
card.uri)
amount_in_cents = 1000 # $10.00 USD
debit = buyer.debit(amount_in_cents, 'MIKES TACOS')
bank_account = Balanced::BankAccount.new(
:account_number => "1234567890",
:bank_code => "321174851",
:name => "Jack Q Merchant",
).save
merchant = Balanced::Marketplace.my_marketplace.create_merchant(
"merchant@example.org",
{
:type => "person",
:name => "Billy Jones",
:street_address => "801 High St.",
:postal_code => "94301",
:country => "USA",
:dob => "1842-01",
:phone_number => "+16505551234",
},
bank_account.uri,
"Jack Q Merchant",
)
credit = Balanced::Credit.new(:amount => amount_in_cents, :appears_on_statement_as => 'MIKES TACOS', :account_uri => merchant.uri).save
puts credit.appears_on_statement_as
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment