Created
October 18, 2012 17:49
-
-
Save mjallday/3913688 to your computer and use it in GitHub Desktop.
Balanced - Attach a card to an account without loading the account first
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
| 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