Quick start
Get Secure Fields integrated on your checkout page.
1. Set up your Payment Form
Follow the recipe below to get started:
Network Tokenisation - mandatory data for token provisoning
To provision a Network Token with Secure Fields you need to submit the expiry month and year and the
usagetype for the alias in thesecureFields.submit()method.Additionally for AMEX, either the
phoneNumberor theemailAddressof the cardholder is required to successfully provision an AMEX token.Currently the following
usagetypes are supported:
Usage Description SIMPLEA simple PCI Proxy alias will be created. Usage type SIMPLEis the default value when the usage field is omitted. This usage type is recommended for when you plan to just forward the alias to another third party.REGISTRATIONA PCI Proxy alias will be created. Additionally a Network Token will be provisioned in the background and mapped to the PCI Proxy alias. Use this usage type when you plan to store the card-on-file for recurring usage.
2. Obtain the tokens
Once you have transmitted the transactionId and the rest of the form to your server, you then need to execute a server-to-server POST request to the GET Token endpoint to retrieve the tokenized card, CVV or bank account details.
Examples:
curl --request POST \
--url 'https://api.sandbox.datatrans.com/v1/tokenizations/{{transactionId}}' \
--header 'Authorization: Basic {{basicAuth}}'
{
"paymentMethod": "VIS",
"alias": "7LHXscqwAAEAAAGScXKLyQTKU0ePANjq",
"fingerprint": "F-dV5V8dE0SZLoTurWbq2HZp",
"maskedCard": "424242xxxxxx4242",
"aliasCVV": "9LjJV6P5QpGQySx52xQ4i72W",
"expiryYear": "26",
"expiryMonth": "12",
"cardInfo": {
"brand": "VISA CREDIT",
"type": "credit",
"usage": "consumer",
"country": "GB",
"issuer": "DATATRANS"
},
"last4": "4242",
"usage": "SIMPLE"
}
{
"paymentMethod": "VIS",
"alias": "AFBWlDuSAAMAAAGYW66KM-YeyjemAHra",
"fingerprint": "F-eklUuoc0KtBTEijk5BKCad",
"maskedCard": "489539xxxxxx2071",
"aliasCVV": "A8W7xDNwT5Kh-FVlq2g6Yez-",
"expiryYear": "28",
"expiryMonth": "06",
"cardInfo": {
"brand": "VISA",
"type": "credit",
"usage": "consumer",
"country": "US",
"issuer": "U.S. REGION",
"accountType": "PAN",
"binLength": 6
},
"networkToken": {
"expiryMonth": "06",
"expiryYear": "28",
"status": "ACTIVE",
"paymentAccountReference": "V0010013023131714085506876186",
"tokenRequestorId": "40010093245",
"token": "4817476115035710"
},
"last4": "2071",
"usage": "REGISTRATION"
}
{
"aliasIban": "AAABeKaD2UbssdexyrAAAUN24QvOZg3n",
"maskedIban": "DE85xxxxxxxxxxxxxx2345"
}
{
"aliasAccountNumber": "AAABeKahwGDssdexyrAAAV8w_R0dlq9b",
"maskedAccountNumber": "xxxx0604",
"aliasBranchCode": "AAABeKahwGDssdexyrAAAadGCQEwl6MZ"
}
Errors
When running the POST request, you may encounter the following errors.
| Error message | Explanation |
|---|---|
| Tokenization expired. | The transactionId has expired. It is only valid for 30 minutes. |
| Tokenization not found. | The merchantId used to create the transactionId does not match the merchantId used in the form. |
Updated 3 months ago