Create a Dintero card token either in advance with a zero-amount setup or during a regular purchase, ready to be reused for later customer or merchant payments.
Tokenization must be activated on your account before you can create or charge card tokens.Contact your Dintero account manager to have it enabled. Until it is activated, requests
that create or use a card token will fail.
There are two ways of creating a card token, either in advance, without withdrawing any money, or during a purchase process.
To authenticate, you create a Checkout API client and use the credentials to
Create an access token. The same client can be used for Sandbox mode and production.For all requests to the API set the following header:
To store a customer’s card information during the payment process, set generate_payment_token to true in the session configuration for the relevant payment provider.When creating the session, include the configuration object with the provider-specific settings:
The generated payment token will be available in the transaction details after a successful payment. It can also be
retrieved by calling get transaction details with ?includes=card.payment_token. If recurrence tokenization is enabled for PayEx,
get transaction details may also return a recurrence token with ?includes=card.recurrence_token.See create session for more information. For payex (Swedbank Pay), it’s also
possible to disable CVC for returning payments if you have a dedicated agreement
with Swedbank Pay.
When using dintero_psp.creditcard, you can let the customer choose whether to save their card by adding
generate_payment_token_config with a save_card_checkbox setting. This displays a checkbox in the checkout UI (see image below).
If generate_payment_token is true and generate_payment_token_config is omitted, the card is always tokenized (no checkbox shown).
save_card_checkbox: "opt_in" — the checkbox is unchecked by default. The customer must actively check it to save their card.
save_card_checkbox: "opt_out" — the checkbox is checked by default. The customer must actively uncheck it to prevent saving.
opt_in — customer must actively choose to save their card: