No momento, esta página não está disponível em português
Marketplace icon

Terms of Service components

Enable users to accept Adyen's Terms of Service using Onboarding components.

To integrate the terms of service components, the minimum required library version is 3.32.0.

You can integrate the terms of service components to enable your users to accept Adyen's Terms of Service documents directly within your marketplace's user interface (UI). The components present the relevant Terms of Service documents to the user and prompt them to sign the documents. After the user accepts the Terms of Service, the components notify Adyen automatically. This means you do not need to make multiple API calls to manage the service agreement process yourself.

This page provides information on:

  • The available contract components, which include the Accept Terms of Service component and the Manage Terms of Service component.
  • The steps needed to integrate these components into your marketplace's UI.

Accept Terms of Service component

The Accept Terms of Service component enables your users to view and accept the required Terms of Service documents within your marketplace's UI.

The Terms of Service documents are only available in English. As a result, these documents will not be translated into other languages, even if you choose a different locale setting for your components.

Manage Terms of Service component

The Manage Terms of Service component enables your users to view the status of the Terms of Service documents when used as a standalone component. If the documents still need to be signed, the component prompts the user to do so.

You can also link the Manage Terms of Service component to the Accept Terms of Service component by using callback functions. This enables users to view and download the signed documents.

Requirements

Before integrating the components, make sure that you:

User flow and callback functions

You can use each component independently to serve its primary purpose, such as to enable users to view and sign the documents, and to view the status of the documents. Alternatively, you can integrate the two components into a single user flow by using the following callback functions:

  • When integrating the Accept Terms of Service component, you can include:
    • an onAccept callback function. This function is triggered when the user signs the Terms of Service document. It returns information about the signed document(s) and the signer in a payload every time the user signs a new document.
    • an onClose callback function. This function is triggered when the user closes the modal window or selects Finish after signing the Terms of Service documents, and it loads the Manage Terms of Service component. This enables the user to view the status of the documents.
  • When integrating the Manage Terms of Service component, you can include an onClick callback function. This function is triggered when the user selects Continue next to the Terms of Service documents, and it loads the Accept Terms of Service component. This enables the user to view and download the signed documents.

See the example data for the onAccept callback function below.

How it works

Follow these steps to integrate the individual legal entity components:

  1. Create an authentication session token
  2. Install and import the component library
  3. Initialize the components
  4. Customize the components

Step 1: Create an authentication session token

To ensure secure communication between your server and front end, a session token is required. To create a session token:

  1. From your server, make a POST request to the /sessions endpoint of the Session authentication API using the API key that you set up for the Legal Entity Management API.

    1. Use the following URLs for this API:

      Environment API URL
      test https://test.adyen.com/authe/api/v1/sessions
      live https://authe-live.adyen.com/authe/api/v1/sessions
    2. In the request body, specify these parameters:

      Parameter Required
      Description
      Example
      allowOrigin -white_check_mark- The URL where the component will appear. Must follow the format of https://www.yourcompany.com or https://*.yourcompany.com, where yourcompany.com is the actual web address of your marketplace.
      On live, only the HTTPS protocol is supported.
      An asterisk (*) cannot be used as a literal value for the parameter.
      product -white_check_mark- The type of component. Set this to onboarding.
      policy -white_check_mark- An object that contains:
      • resources: An object that contains:
        • legalEntityId: The unique identifier of the legal entity associated with the user that has a contractual relationship with your marketplace and who will sign the Terms of Service documents.
        • type: The type of resource. Set this to legalEntity.
      • roles: The role(s) required to use the component(s). Set this to acceptTermsOfServiceComponent and/or manageTermsOfServiceComponent.

      Here is an example request for creating a session token.

  2. Note the API response. Later, when initializing the components, you need to create and call a function that passes the entire session object from the response to your front end. Additionally, you need to pass the token value to the sdkToken parameter.

Step 2: Install and import the component library

Use the Adyen KYC Components library in your front-end application as follows:

  1. Install the node package.

    npm install @adyen/kyc-components --save
  2. Import the node package and the style sheet. To customize the component styling, see Step 4.

    import AdyenKyc from '@adyen/kyc-components';
    import '@adyen/kyc-components/styles.css';

Step 3: Initialize the components

To initialize components:

  1. Gather the following information to be passed when initializing the library and its components.

    1. Gather these parameters to initialize the library.

      Parameter Required
      Description
      Example
      locale -white_check_mark- The language of the component. See the list of supported languages. Use en-US for English.
      country -white_check_mark- The two-letter ISO 3166-1 alpha-2 country code of the legal entity. Use US for the United States of America.
      environment -white_check_mark- The URL of the environment for the component integration. Use https://test.adyen.com/ for the test environment and https://onboardingcomponents-live.adyen.com/ for the live environment.
      sdkToken -white_check_mark- The token received from the create session token API response.
      getSdkToken -white_check_mark- The function callback for refreshing/extending the current session.
    2. Gather these parameters to initialize each component.

      Select the tab for the component you want to use:

  2. Create a DOM element on your UI page where you want the component to be rendered and assign it a unique and descriptive ID. This unique ID is important to avoid any misconfigurations when integrating multiple components into your UI.

    Select the tab for the component you want to use:

  3. Add a function that calls your API to generate a new authentication session token.

    Select the tab for the component you want to use:

  4. Initialize the library, then create and mount the component to the container you created. At this step, you can localize the components by setting a preferred language.

    Select the tab for the component you want to use:

    If you use callback functions to integrate the two components into a single user flow, refer to the following example implementation:

Step 4: (Optional) Customize the components

You can customize the appearance of components by overriding the default CSS styles of colors, fonts, borders, and more. For the best user experience when customizing components, we recommend the following:

  • Choose color combinations that complement each other well and provide enough contrast for readability, especially for text and navigation elements.
  • Follow accessibility guidelines to ensure that the color palette is inclusive and usable for individuals with visual impairments.
  • Test your customizations before implementing them live.

To override the default CSS values of the component:

  1. Identify the CSS variable you want to change. Select the corresponding tab to view the available CSS variables and their default values for fonts, background color, outline color, and border settings.

  2. Set a new value for this CSS variable at the root level. Select the corresponding tab to view the examples.

See also