Skip to content

Instantly share code, notes, and snippets.

@Swizec
Created Feb 12, 2013
Embed
What would you like to do?
# this is the reequest body as per dashboard
{
"card_uri": null,
"meta": null,
"email_address": "alvena@carternader.info",
"name": null
}
# ruby library uses this to make that request
def create_account options={}
email_address = options.fetch(:email_address) { nil }
name = options.fetch(:name) { nil }
meta = options.fetch(:meta) { nil }
account_attributes = {
:uri => self.accounts_uri,
:email_address => email_address,
:name => name,
:meta => meta
}
account = Account.new account_attributes
account.save
end
# my code runs it like so:
puts 'creating seller and setting token'
seller_account = Balanced::Marketplace.my_marketplace.create_account(:email_address => seller.email)
seller_merchant_uri = seller_account.uri
seller.customer_token = seller_merchant_uri
puts 'seller token'
seller.save!
puts seller.customer_token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment