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 usage type for the alias in the secureFields.submit() method.

Additionally for AMEX, either thephoneNumber or theemailAddress of the cardholder is required to successfully provision an AMEX token.

Currently the following usage types are supported:

UsageDescription
SIMPLEA 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.
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"
}
{
  "aliasIban": "AAABeKaD2UbssdexyrAAAUN24QvOZg3n",
  "maskedIban": "DE85xxxxxxxxxxxxxx2345"
}
{
  "aliasAccountNumber": "AAABeKahwGDssdexyrAAAV8w_R0dlq9b",
  "maskedAccountNumber": "xxxx0604",
  "aliasBranchCode": "AAABeKahwGDssdexyrAAAadGCQEwl6MZ"
}

Errors

When running the POST request, you may encounter the following errors.

Error messageExplanation
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.