Skip to content

Instantly share code, notes, and snippets.

@mjallday
Last active December 14, 2015 22:19
Show Gist options
  • Save mjallday/5157581 to your computer and use it in GitHub Desktop.
Save mjallday/5157581 to your computer and use it in GitHub Desktop.
Balanced Ruby Bank Account Invalidates
require 'balanced'
host = ENV.fetch('BALANCED_HOST') { nil }
options = {}
if host
options[:scheme] = 'http'
options[:host] = host
options[:port] = 5000
end
api_key = Balanced::ApiKey.new.save
Balanced.configure( api_key.secret, options)
marketplace = Balanced::Marketplace.new.save
bank_account = marketplace.create_bank_account(
:account_number => "1234567890",
:bank_code => "12",
:name => "Jack Q Merchant",
)
merchant = marketplace.create_merchant(
:email_address => "merchant@example.org",
:merchant => {
:type => "person",
:name => "Billy Jones",
:street_address => "801 High St.",
:postal_code => "94301",
:country => "USA",
:dob => "1842-01",
:phone_number => "+16505551234",
},
:bank_account_uri => bank_account.uri,
:name => "Jack Q Merchant",
)
bank_account = merchant.bank_accounts[0]
raise "wtf" if not bank_account.is_valid
bank_account.save()
raise "wtf" if not bank_account.is_valid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment