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
To provision a Network Token with Secure Fields you need to submit the expiry month and year and the
usage
type for the alias in the secureFields.submit() method. Only submit the property when your merchantID is enabled for Network Tokenisation.Currently the following
usage
types are supported:
Usage Description SIMPLE
A simple PCI Proxy alias will be created. Usage type SIMPLE
is 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.REGISTRATION
A 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. .
If you're not sure about the
usage
type of an alias you can check it by calling the Token Status api and listen for the usage property in the response.
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}}' \
--header 'Idempotency-Key: e75d621b-0e56-4b71-b889-1acec3e9d870'
{
"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"
}
{
"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 about 1 month ago