Skip to content

Instantly share code, notes, and snippets.

@rserna2010
Created December 27, 2013 18:43
Show Gist options
  • Select an option

  • Save rserna2010/8150938 to your computer and use it in GitHub Desktop.

Select an option

Save rserna2010/8150938 to your computer and use it in GitHub Desktop.
Adding a customer
1) create customer
curl https://api.balancedpayments.com/v1/customers \
-u KEY_SECRET: \
-X POST
2) Add credit card
curl https://api.balancedpayments.com/v1/marketplaces/MARKETPLACE_URI/cards \
-u KEY_SECRET: \
-d "expiration_month=12" \
-d "security_code=123" \
-d "card_number=5105105105105100" \
-d "expiration_year=2020"
3) Associate the token with the customer:
curl https://api.balancedpayments.com/v1/customers/CU3M02zALmiR1mO1UFfUzcrA \
-u KEY_SECRET: \
-X PUT \
-d "card_uri=/v1/marketplaces/MARKETPLACE_URI/cards/CC6PwpswTESNNg8jSD0PR87e"
4) Debit the customer:
curl https://api.balancedpayments.com/v1/customers/CU3M02zALmiR1mO1UFfUzcrA/debits \
-u KEY_SECRET: \
-d "appears_on_statement_as=Statement text" \
-d "amount=5000" \
-d "description=Some descriptive text for the debit in the dashboard"
1) create customer
curl https://api.balancedpayments.com/v1/customers \
-u ak-test-1V39mCIJ2IHAqzta5Rx8uT9HYpXKGo1zf: \
-X POST
2) Add credit card
curl https://api.balancedpayments.com/v1/marketplaces/TEST-MP53kbWTbjvlWipXl8jHQndu/cards \
-u ak-test-1V39mCIJ2IHAqzta5Rx8uT9HYpXKGo1zf: \
-d "expiration_month=12" \
-d "security_code=123" \
-d "card_number=5105105105105100" \
-d "expiration_year=2020"
3) Associate the token with the customer:
curl https://api.balancedpayments.com/v1/customers/CU5Ep7CfrxyjD5pvOvbm7vEs \
-u ak-test-1V39mCIJ2IHAqzta5Rx8uT9HYpXKGo1zf: \
-X PUT \
-d "card_uri=/v1/marketplaces/TEST-MP53kbWTbjvlWipXl8jHQndu/cards/CC5W1JuX0fPl4eLTVOswHu92"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment