Skip to content

Instantly share code, notes, and snippets.

@Swizec
Last active December 12, 2015 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swizec/4771602 to your computer and use it in GitHub Desktop.
Save Swizec/4771602 to your computer and use it in GitHub Desktop.
buyer = Balanced::Account.find customer_token
if seller.customer_token.nil? || seller.customer_token =~ /cus_/
puts 'creating seller and setting token'
# this throws error
seller_account = Balanced::Marketplace.my_marketplace.create_account(:email_address => seller.email)
puts "I got this!"
seller_merchant_uri = seller_account.uri
seller.customer_token = seller_merchant_uri
puts 'seller token'
seller.save!
puts seller.customer_token
else
seller_merchant_uri = seller.customer_token
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment