Skip to content

    Customize text and language

    This guide is for developers who want to localize and customize text resources on their checkout page.

    Complexity: Low
    Coding: Some (Backend)
    Platform:

    Before you start

    This guide assumes that you already have an Easy Portal account and have integrated Easy Checkout on your website.

    What you are building

    Once you have your Nets Easy Checkout page integrated into your site, it’s time to customize it to make it fit your site and provide the best possible service to your customers. This page will guide you through the following customizations:

    • Select language - the language to be used on the checkout page
    • Set text on the payment button - the text resources on the pay button can be customized when using subscriptions (recurring payments).
    • Display webhsop name - the name of your webshop can be added to the checkout page.
    • Show order items - the order items can be listed on the checkout page.
    Text customizations

    Set display language

    You can change the language to be used on the checkout page by adding an optional language parameter to the URL to hosted checkout page. The following example changes the default display language from English to Swedish when redirecting to the pre-built checkout page hosted by Nets:

    Specify display language

    create-payment.php
    function redirect_to_checkout($json) {
      $a = json_decode($json, true);
      if (json_last_error() != JSON_ERROR_NONE) {
            echo(json_last_error_msg());
            var_dump($json);
            exit("Unable to parse json response");
      }
      $redirectURL = $a['hostedPaymentPageUrl'];
      if (empty($redirectURL)) {
            var_dump($json);
            exit("Could not find the key 'hostedPaymentPageUrl'");
      }
      $lang = 'sv-SE';
      $redirectURL = $redirectURL . '&language=' . $lang;
      header("Location: " . $redirectURL);
      exit();
    }

    The redirect happens right after a payment object has been created from the backend. The example above is extracted from the direct integration guide where you can see a complete example of creating a payment object and performing a redirect.

    The complete list of available language can be found in the API reference.

    Customize payment button text

    The text label on the payment button can be customized. The Payment API defines a set of predefined values that can be selected among when creating the payment object from the backend of your site. See the direct integration guide for a complete example of how to create a new payment object.

    To customize the payment button, the JSON request object posted with the create payment method should define the property completePaymentButtonText. Here is an example of a request body:

    Specify payment button text

    {
      "checkout": {
        "integrationType": "EmbeddedCheckout",
        "url": "https://<YOUR_SERVER>/checkout.html",
        "termsUrl": "https://<YOUR_SERVER>/terms.htmtl",
        "appearance": {
          "textOptions": {
            "completePaymentButtonText": "signup"
        }
      },
      "order": {
        ...
      }
    }

    The string value signup is one of the predeifined values that can be specified. If you are using English on the checkout page, the payment button will now include the text "Sign up". The payment button text is localized.

    You can determine the button's background color as well by using the buttonbackgroundColor parameter.

    Display merchant name

    It is possible to show the name of your webshop (merchant name) on the checkout page. The option to show or hide the merchant name is specified when creating the payment object using the Payment API from your backend.

    Use the property showMerchantName to show or hide the merchant name on the checkout page, like this:

    Show merchant name on checkout page

    {
      "checkout": {
        "integrationType": "EmbeddedCheckout",
        "url": "https://<YOUR_SERVER>/checkout.html",
        "termsUrl": "https://<YOUR_SERVER>/terms.htmtl",
        "appearance": {
          "displayOptions": {
            "showMerchantName": true
          }
      },
      "order": {
        ...
      }
    }

    The example above makes the merchant name appear on the checkout page.

    Troubleshooting

    The merchant name to be displayed on the checkout page can only be specified once your account is in live mode. There is no way to specify the merchant name while in test mode.

    Include order summary

    The order items associated with the current payment can be listed on the checkout page. A button that makes it possible for your customer to show or hide the order items is then included on the checkout page. Again, this customization is defined when creating the payment object from your backend.

    Use the property showOrderSummary to include the order items on the checkout page as in the following example:

    Show order summary

    {
      "checkout": {
        "integrationType": "EmbeddedCheckout",
        "url": "https://<YOUR_SERVER>/checkout.html",
        "termsUrl": "https://<YOUR_SERVER>/terms.htmtl",
        "appearance": {
          "displayOptions": {
            "showOrderSummary": true
          }
      },
      "order": {
        ...
      }
    }

    This guide has demonstrated how to customize the language and what content to be included on the checkout page. It's also possible to customize UI properties such as colors and fonts. See the guide Styling and accessibility.