No momento, esta página não está disponível em português
Point-of-sale 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.

The available libraries are:

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

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

The library 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.

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 (9)"
   ],
   "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:

Crypto error Cause
crypto error (1) There is a problem with parsing the request. This can be due to a syntax error.
crypto error (2) The version number of the shared key in your code is unknown.
crypto error (3) There is a problem with the message header of the request.
crypto error (4) There is a problem with the body of the request.
crypto error (5) There is a problem with the security trailer of the encrypted message. The trailer uses the version and identifier of the shared key.
crypto error (6) There is a problem with the passphrase of the shared key.
crypto error (7) The nonce is missing or incorrect. The nonce must have a length of 16 bytes.
crypto error (8) The HMAC key is missing or incorrect. The HMAC key must have a length of 32 bytes.
crypto error (9) The shared key details in your code do not match the shared key that is set up in your Customer Area.

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