Created
February 12, 2013 20:10
-
-
Save Swizec/4772958 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is the reequest body as per dashboard | |
{ | |
"card_uri": null, | |
"meta": null, | |
"email_address": "[email protected]", | |
"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