Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>UPDATE</strong></p> <ul> <li>For IOS please use the <a href="https://github.com/balanced/balanced-ios" rel="nofollow">balanced-ios</a> library</li> <li>For Android please use the <a href="https://github.com/balanced/balanced-android" rel="nofollow">balanced-android</a> library</li> </ul> <hr> <p>Since you're writing for a smartphone you should be able to make a RESTful API call directly to Balanced to tokenize the card without using balanced.js.</p> <p>The card and bank account endpoints don't require authentication to tokenize these resources so you don't need to worry about including any API keys with the app. The documentation explains how to <a href="https://www.balancedpayments.com/docs/api#tokenize-a-credit-card" rel="nofollow">tokenize the card</a> but let me explain it in more detail:</p> <p><strong>TL;DR</strong></p> <p>Make a POST directly from your mobile app to the <code>card_uri</code> or <code>bank_account_uri</code> that is associated with your Marketplace and it will return a response which includes the tokenized resource's URI.</p> <p><strong>Example</strong></p> <p>If your Marketplace's URI was <code>/v1/marketplaces/M123-456-7890</code> then the flow would look like this:</p> <p><strong>On the client</strong></p> <p>The payload you pass through should look like:</p> <pre><code>{ "card_number": "5105105105105100", "expiration_month": "01", "expiration_year": "2020", "security_code": "123" } </code></pre> <p>This should then be submitted like such</p> <pre><code>POST /v1/marketplaces/M123-456-7890/cards </code></pre> <p>The response will look something like:</p> <pre><code>{ "brand": "visa", "name": null, "expiration_year": 2020, "uri": "/v1/marketplaces/TEST-MP991-204-5261/cards/CCfc1596189e0911e18ba9024f5cb9b783", "expiration_month": 12, "state": "new", "last_four": 5100, "address": null } </code></pre> <p>The client then only needs to return the <code>uri</code> of the response to your server, on the server you can associate the card with the user's account.</p> <p><strong>On the server</strong></p> <p>To associate the card's URI with an existing account you can make a <code>PUT</code> request to the account's URI with the URI of the card passed through as a parameter called <code>card_uri</code>. If you're creating a new account then <code>POST</code> to the marketplaces <code>accounts_uri</code> with the email address of the user.</p> <p>What you want to be careful of is that you don't log the user's <code>card_number</code> or <code>security_code</code> in any debugging log on the device as this would bring the device into PCI scope and could be bad if their phone was compromised.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload