Configuring the notification webhooks

How to set up Adyen's notification system

Problem

You want to rely on Adyen's webhooks notification system, which is the only way can receive automatic updates about requests that are processed asynchronously (e.g. iDEAL transactions or payment modifications — captures, voids, and refunds).

Solution

You can enable Adyen's notification system in two separate steps:

  1. Configure the notification webhooks on your Adyen's customer area.

  2. Update your Adyen gateway on Commerce Layer

1. Configure the notification webhooks

To configure the notification system, first you need to access your Adyen's customer area and follow the procedure detailed here. On the Server configuration and Security sections, make sure to perform the following actions:

  • Select JSON as the method.

  • Select TLSv1.2 as the protocol.

  • Generate the HMAC key to verify the integrity of notifications and copy it.

Commerce Layer does not support the Adyen webhooks SOAP or HTTP methods, but the JSON one only.

2. Update your gateway

Once the notification webhooks are properly configured, you need to update your Adyen gateway and specify you're going to support the asynchronous notifications system.

To do that, send a PATCH request to the /api/adyen_gateway/:id endpoint, setting the async_api attribute as true and passing the HMAC key you generated in the previous step as the webhook_endpoint_secret value.

Example

The following request updates the Adyen gateway identified by the "HGFvfREwAX" ID in order to use the Adyen asynchronous APIs:

curl -g -X PATCH \
  'http://yourdomain.commercelayer.io/api/adyen_gateways/HGFvfREwAX' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "adyen_gateways",
    "id": "HGFvfREwAX",
    "attributes": {
        async_api: true,
        webhook_endpoint_secret: 'xxxx-yyyy-zzzz'
      }
    }
  }
}'

Be sure to enable webhooks on the Adyen dashboard as the very first step, and by the way always before setting the gateway's async_api attribute to true, otherwise you risk all of your payment modifications failing silently.

More to read

Last updated