Terminal-2 icon

Protect with a library

Use an Adyen GitHub library to protect local communications between your POS app and terminal.

If your integration uses local communications, you need to protect your integration against man-in-the-middle attacks, eavesdropping, and tampering. To help you with this, we provide GitHub libraries that:

  • Validate the terminal certificate, to confirm your POS app is communicating directly with an Adyen-supplied payment terminal.
  • Encrypt communications. This prevents intruders from reading the messages transmitted between the POS app and the terminal.

These GitHub libraries work with Terminal API and are completely separate from the classic libraries, which have been deprecated.

Encrypt communications

The available libraries are:

The libraries will:

  • Serialize the request object to JSON and then encrypt and sign the request.
  • Send the request and receive the response.
  • Decrypt and deserialize the response and pass the content to the response object.

Select a tab below for the Adyen GitHub library you want to use.

Full code samples

Select a tab in the code sample block below to see the code for encrypting communications. In all cases you need to know the key identifier, passphrase, and version of your shared key.

To find the details of your shared key in your Customer Area:

  1. Under In-person payments, go to the Terminal settings for your merchant account or store.
  2. Select Integrations and under Terminal API go to Encryption key.
  3. To see the key identifier, passphrase, and version values, select Decrypted.

Troubleshooting

Crypto errors and SSL connection errors indicate a problem with the protection of the local communications.

Crypto errors

Example:

Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.

The response body contains:

{
   "errors":[
      "Nexo Service: crypto error"
   ],
   "ServiceID":"1234567890"
}

Cause: Crypto errors are related to the shared key. After you set up the shared key in your Customer Area, the shared key values in your code must match the shared key values in the Customer Area.

If you are using a library, check the values for the relevant object:

If you are using your own code:

SSL connection error

Example:

Exception : System.Net.WebException: The SSL connection could not be established

Possible cause: Adyen's root certificate is not installed correctly.

See also