Skip to main content

Create an Adyen Connection

This recipe explains how you can create a Conscia Connection to the Adyen payment provider. You can implement a solution based on this recipe to create a connection to any API that uses tokens in HTTP headers to authenticate.

Conscia Components can use Conscia Connections to encapsulate the information used to connect to a system that exposes Web services. Components that access Adyen APIs can use an Adyen Connection created based on this recipe.

To provide the authentication required to invoke Adyen APIs, we can pass an Adyen API Key token in the X-API-Key HTTP header. Review the Adyen documentation to create an API key:

Copy the value of the token to a safe location for temporary storage.

Mapping Out DX Engine Elements

This recipe involves a Conscia Connection, which encapsulates the information used to connect to Adyen, and a Conscia Secret, which stores the Adyen API Key used to authenticate.

DX Engine Configuration Details

We can store the Adyen API key in Conscia as a secret. To create the secret, in the Conscia UI:

  1. Click Settings in the top-nav, and then select Secrets.
  2. Click Add Secret
  3. Set Secret Code to a value such as adyen-x-api-key.
  4. Set Secret Name to a value such as Adyen X-API-Key.
  5. Set Secret Value to the Adyen API Key token.
  6. Optionally, enter a Description for the secret.
  7. Click Submit.

alt_text

To create the Adyen Connection, in the Conscia UI:

  1. Click Settings in the top-nav, and then select Connections.
  2. Click Add Connection.
  3. Set Connection Code to a value such as adyen-connection.
  4. Set Connection Name to a value such as Adyen Connection.
  5. Optionally, enter a Connection Description for the connection.
  6. Select the Universal API Connector.
  7. Click Submit.

alt_text

To configure the Adyen Connection, in the Conscia UI:

  1. Click the Edit button for the Adyen Connection.
  2. Under Base URL, for Get value from, select Literal.
  3. Set the value of Base URL to the Adyen API base URL, such as https://checkout-test.adyen.com/v71.
  4. Under Base Headers, click Add another item.
  5. For the new header, set Header to X-API-Key.
  6. For the new header, set Value to Secret.
  7. For the value of the new header, select the secret created previously, such as Adyen X-API-Key.
  8. Click Submit.

alt_text

Any Conscia Component that uses this connection can specify a URL path relative to the value of Base URL and will include the X-API-Key HTTP header with the value of the secret.

Remember to remove the Adyen token from temporary storage if desired.

Note that the same Connection in a test, production, and any other Conscia Environments may use different Base URL and X-API-Key values than that of the Connection in Preview environment.

References