Authorize payments with network tokens
Choose whether a payment uses the card's network token, and retry with the card number when the issuer declines it.
When a saved card has a network token, Pay.com can send the token to the issuer instead of the card number. Turn this on for your account or for each payment, and choose whether a declined payment retries with the card number.
Options
payment_method_options.card.network_token.authorization takes three fields.
| Field | Type | Description |
|---|---|---|
enabled | boolean | Authorizes the payment with the card's network token. |
full_pan_fallback | boolean | Retries with the card number if the issuer declines the payment made with the network token. |
fallback_decline_codes | array of strings | The decline codes that trigger the retry, for example do_not_honour. Without it, the processor's default codes apply. |
Authorize a payment with the network token
Set the options on the charge or hold. Amounts are in minor units (for example, 2000 is $20.00 USD). This charge pays with the saved card's network token and retries with the card number if the issuer declines with do_not_honour.
curl -X POST https://api.sandbox.pay.com/v1/charges \
-u ':sk-pay-com-sandbox-…' \
-H "Content-Type: application/json" \
-d '{
"amount": 2000,
"currency": "usd",
"source": "pm_card_296645958265997316",
"payment_method_options": {
"card": {
"network_token": {
"authorization": {
"enabled": true,
"full_pan_fallback": true,
"fallback_decline_codes": ["do_not_honour"]
}
}
}
}
}'{
"id": "chrg_687257433738839040",
"resource": "charge",
"amount": 2000,
"currency": "usd",
"status": "succeeded"
}The same payment_method_options work on holds, and on payment and checkout sessions.
Set your account's default
To authorize every card payment with network tokens, set card.network_token.authorization in your account's payment method options. A payment that sets its own options overrides the default. See Set your account's default.
Next steps
- Provision network tokens: Request tokens for the cards you save.
- Declines: Every decline code and what to do about it.