Displaying translated or customized labels

Background
Before starting this tutorial, make sure you understand the following topics from the Quick start section:

Nexio provides translations for labels for several languages and locales. You can use those with your site, you can customize those translations, and you can create translations for other languages or locales.

📘

Note

Nexio currently provides translation files for the following languages and regional dialects:

To customize existing or create new translations, see the Customizing iframe labels topic.

Regardless of whether you use the standard language files, create your own, or customize an existing one, the steps to display those labels are the same:

  1. Identify the label file you want to use and its location.

    For the locations for the standard translations of the labels, see the Note above.

    For the location for new or changed translations, refer to the information in the Customizing the iframe labels topic.

  2. Send a POST request to the Create one-time-use token endpoint.

    • Include the uiOptions.customTextUrl parameter in the body of the request and set the value to the URL of the labels file to use for the iframe.

      For example, to use the default Spanish labels, the request looks similar to the following:

      curl -X POST https://api.nexiopaysandbox.com/pay/v3/token \
        -H 'Content-Type: application/json' \
        -H 'Accept: application/json' \
        -H 'Authorization: Basic [Base64_encoded_login]' \
        -d '{
        "uiOptions": {
          "customTextUrl": "https://customerassets.nexiopay.com/CMSLabels_es.json"
        }
      }'
      

      The response includes a token parameter. Encoded within this value is the URL of the labels file. Save this token for use in the next step.

      {
        "expiration": "2022-09-18T15:43:05.664Z",
        "fraudUrl": "https://api.nexiopaysandbox.com/pay/v3/fingerprint?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2",
        "token": "830d36f6-a5e3-4455-9600-3a55b63e2fc2"
      }
      

  3. Request the iframe to display on the page using the token from the response in step 2.

    You may display translated or customized labels for any of the following types of pages:

    For example, the following request uses the token to return the HTML for an iframe for saving payment information for a card (as a token), with the labels from the standard translation file for Spanish (as specified in step 2).

    curl -X GET https://api.nexiopaysandbox.com/pay/v3/saveCard?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2 
    

    The resulting HTML results in an iframe that could look similar to the following:

959

Iframe for Save Card in Spanish