Testing Network Tokens
Before testing network tokens in sandbox, make sure your account is fully enrolled to network tokenization.
Speak to your Customer Success Manager or raise a ticket on our JIRA Service Desk. If you don’t have access, please contact your account administrator for assistance.
Visa’s testing environment is frequently reset, which makes testing Visa network tokens extremely unreliable.
As a result, testing Visa network tokenization is not available on Primer sandbox. We encourage you to only test Mastercard network tokenization in sandbox, and to test Visa network tokenization in production.
Provisioning network tokens
On sandbox, Primer attempts to provision a network token whenever a card is added to the vault of a customer ID starting with primer-nt-testing
.
The best way to vault a card is to use Universal Checkout. Make sure to call
with a “customerId” and “vaultOnSuccess” set totrue
. This automatically vaults the card if the payment is successfully authorized.
This first payment is processed using the raw card data. Once vaulted, it usually takes a few seconds for the network token to be provisioned and available for subsequent payments.
Use the following test cards to simulate scenarios:
Scenario | Card Network | Card Number | CVV | Expiry date |
---|---|---|---|---|
Eligible card | Mastercard | 2222 6904 2006 4590 | Any 3 digit number | Any future expiry date |
Eligible card | Mastercard | 2222 6904 2006 4574 | Any 3 digit number | Any future expiry date |
Eligible card | Mastercard | 2222 6904 2006 4590 | Any 3 digit number | Any future expiry date |
Eligible card | Mastercard | 5120 3501 0006 4594 | Any 3 digit number | Any future expiry date |
Non-eligible card | Mastercard | 5460 1261 2820 0800 | Any 3 digit number | Any future expiry date |
To validate that the card was properly network tokenized, call
to list the saved payment methods for a specificcustomerId
. The field “paymentMethod.isNetworkTokenized” is set to true
when the network token was successfully provisioned and attached to the vaulted card.
Processing payments with network tokens
When a payment is created with a vaulted card that has been network tokenized, Primer automatically attempts to pass the network token to the processor, if the processor is supported.
You can test this by creating a payment with:
- the Payments API by following this guide
- or with the vault section of Universal Checkout, by selecting a vaulted card that was network tokenized
To validate that the payment used a network token, call
with the payment ID to retrieve the payment object. The field “cardTokenType” is set to:NETWORK_TOKEN
if the payment was processed with a network tokenCARD_PAN
if the payment was processed with the raw credentials