Skip to content

Instantly share code, notes, and snippets.

@mjallday
Created October 18, 2012 17:49
Show Gist options
  • Select an option

  • Save mjallday/3913688 to your computer and use it in GitHub Desktop.

Select an option

Save mjallday/3913688 to your computer and use it in GitHub Desktop.
Balanced - Attach a card to an account without loading the account first
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
account = Balanced::Account.new(:email_address=> '[email protected]').save
account_with_card = Balanced::Account.new(:uri=>account.uri, :card_uri=>card.uri).save()
puts account_with_card.uri
for card in account_with_card.cards:
puts card.uri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment