Adyen In-person Payment Demo Integration Demo
This demo shows developers how to use the Adyen Cloud Terminal API /terminal-api/sync
to make requests to your connected terminal.
The following implementations are included:
There are typically two ways to integrate in-person payments: local or cloud communications. To find out which solution (or hybrid) suits your needs, visit the following documentation page.
You can find the Terminal API documentation here.
This demo integrates the Adyen's API Library for Node.js (GitHub | Docs).
- A terminal device and a test card from Adyen
- Adyen API Credentials
- Node.js 20+
git clone https://github.com/adyen-examples/adyen-node-api-library.git
- API key
- HMAC Key
ADYEN_POS_POI_ID
: the unique ID of your payment terminal for the NEXO Sale to POI protocol.- Format:
[device model]-[serial number]
Example:V400m-123456789
- Format:
Create a ./.env
file with all required configuration
PORT=8080
ADYEN_API_KEY="your_API_key_here"
ADYEN_MERCHANT_ACCOUNT="your_merchant_account_here"
ADYEN_CLIENT_KEY="your_client_key_here"
ADYEN_HMAC_KEY="your_hmac_key_here"
ADYEN_POS_POI_ID=="your_pos_poi_id"
cd in-person-payments-example
npm install
npm run dev
Visit http://localhost:8080/ and perform payments and refunds
Webhooks deliver asynchronous notifications about the payment status and other events that are important to receive and process. You can find more information about webhooks in this blog post.
In the Customer Area under the Developers → Webhooks
section, create a new Standard webhook
.
A good practice is to set up basic authentication, copy the generated HMAC Key and set it as an environment variable. The application will use this to verify the HMAC signatures.
Make sure the webhook is enabled, so it can receive notifications.
The following webhooks events
should be enabled:
- AUTHORISATION
- CANCEL_OR_REFUND
- REFUND_FAILED
- REFUNDED_REVERSED
This demo provides a simple webhook implementation exposed at /api/webhooks/notifications
that shows you how to receive, validate and consume the webhook payload.
To make sure that the Adyen platform can reach your application, we have written a Webhooks Testing Guide that explores several options on how you can easily achieve this (e.g. running on localhost or cloud).