Tokenize cards

This page will explore the different ways to tokenize the customer's card within the payment process. With the creation of the Intent, there are 3 different flags you can send MoneyHash to take different paths to choose whether to tokenize it or not.

When MoneyHash creates a card token, this data will be saved on our Vault, and the token will be added as a saved_card on the respective customer entity.

Tokenization

To start, you will create an intent using the Create Intent endpoint:

POST
/api/v1.1/payments/intent/

In the payload, with the required fields (amount, amount_currency, operation and webhook_url), you first need to add the customer that will be the owner of the tokenized card:

PropertyTypeDescription
amountNumberThe amount to charge in the payment process.
amount_currencyStringThe currency of the amount is represented by a string of alphabetic codes from ISO 4217 Currency codes.
operationStringThe type of the current intent. It can be one of purchase, authorize, or capture.
webhook_urlStringA URL that the MoneyHash server will send a POST request to you when needed.
customerStringThe unique identifier of the customer that owns the saved card.

Furthermore, you will add one of the following flags, indicating the path you desire to take:

PropertyTypeDescription
tokenize_cardBooleanThis flag will define at the creation of the intent if the card should be tokenized or not. If true, MoneyHash will create the card token, and if false, it won't create it.
{
  "amount": 50,
  "amount_currency": "USD",
  "operation": "purchase",
  "customer": "0fbc1fcd-0206-46d1-8e3c-28491c17b3ce",
  "webhook_url": "https://webhook.site/4d487d3a-2644-4e48-b985-46ccd7350a29",
  "tokenize_card": true
}
PropertyTypeDescription
show_save_card_checkboxBooleanThis flag, if true will show a checkbox with the card information fields, allowing the customer to choose whether to save their card by creating the token or not.
{
  "amount": 50,
  "amount_currency": "USD",
  "operation": "purchase",
  "customer": "0fbc1fcd-0206-46d1-8e3c-28491c17b3ce",
  "webhook_url": "https://webhook.site/4d487d3a-2644-4e48-b985-46ccd7350a29",
  "show_save_card_checkbox": true
}
PropertyTypeDescription
show_mandatory_save_card_checkboxBooleanSimilar to the show_save_card_checkbox option, this will also show a checkbox with the card information fields. The difference is, in this respective flag, the customer can only proceed with the payment if they allow the card to be tokenized and saved.
{
  "amount": 50,
  "amount_currency": "USD",
  "operation": "purchase",
  "customer": "0fbc1fcd-0206-46d1-8e3c-28491c17b3ce",
  "webhook_url": "https://webhook.site/4d487d3a-2644-4e48-b985-46ccd7350a29",
  "show_mandatory_save_card_checkbox": true
}

Note

You cannot use more then one of the flags displayed above. Choose one of then to select a way to tokenize the cards.


Token Sharing Group

You can facilitate the sharing of card tokens across various connections within the same provider by establishing a token sharing group and assigning it to each connection where you intend to utilize these shared card tokens

🚧

Token Type Compatibility

This setup is designed to function with all card token types. However, it's essential to bear in mind that for seamless integration within a payment flow, you need to create UNIVERSAL card tokens

Follow these steps to create a token-sharing group:

  1. Navigate to Connection: Access the provider you wish to share tokens with.
  2. Select Payment Method: Within the connection configuration, locate the 'Pay-In' section, then proceed to the 'Card Method'.
  3. Create Token Sharing Group: Look for the option to create a token-sharing group. Provide a distinct name for this group, signifying the collection of card tokens you intend to share.
  4. Assign Tokens: After creating the group, proceed to each connection of the same provider. In the settings of each connection, find the option to assign the token-sharing group previously created.

👍

Cross-Account Functionality

The token sharing group functionality extends across accounts within the same organization. This means that it can be utilized across different accounts, provided they are under the same organizational umbrella and they are UNIVERSAL card tokens

🚧

Provider Restriction

While the token sharing group facilitates sharing across accounts, it's important to adhere to the restriction of utilizing connections from the same provider type. For instance, sharing between 'Provider X 1' and 'Provider X 2' connections is feasible as long as they belong to the same provider.