Skip to main content

Goal

Enable a returning user to submit a transaction using a previously-stored payment credential. Process using a stored card

Steps

Step 1: Display stored credentials and enable selection

What you need to do

Display the user’s previously-stored payment credentials and allow them to select one for the transaction. In order to support users adding new cards, follow the steps from process a new card.

How to do it

  1. Call the list-user-credentials endpoint with the user’s ID.
  2. Render the returned credentials in your UI, including the information about the linked card, account, and bank so they are easily identifiable.
  3. Allow the user to select which credential they would like to use for the payment.
If the user is withdrawing funds, only allow them to select credentials that are enabled for withdrawals. Only credentials with type secure_debit can be used for withdrawals.

Step 2: Submit the payment for authorization

What you need to do

Submit the payment using the credential selected by the user.

How to do it

  1. Call the authorize-payment endpoint with the payment details and selected credential ID.
  2. Display the result (approved or declined) to the user.
curl --request GET \
  --url https://sandbox.pushcash.com/user/{id}/credentials \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "cred_7YlA9IiSl8UZvNwNSbFajV",
      "created_at": "2023-05-24T20:15:18.158Z",
      "card_last4": "4444",
      "authenticated": true,
      "type": "secure_debit",
      "account_last4": "0685",
      "bank_name": "Chase Bank"
    },
    {
      "id": "cred_8ZlB0JjTm9VZaOxOTcGbkW",
      "created_at": "2023-05-25T10:20:30.123Z",
      "card_last4": "1234",
      "authenticated": true,
      "type": "card_only_credit",
      "account_last4": null,
      "bank_name": null
    },
    {
      "id": "cred_9AmC1KkUn0WabPyPUdHclX",
      "created_at": "2023-05-26T14:35:45.456Z",
      "card_last4": "5678",
      "authenticated": true,
      "type": "card_only_debit",
      "account_last4": null,
      "bank_name": null
    }
  ]
}

Integration checklist

  • Verify that only secure_debit type credentials are available for withdrawals
  • Test by adding a new card then submitting a second transaction using the stored payment credential.

Next steps

Now that users can process using stored credentials, learn how to process payments which require users to complete authentication.