Test integrations with Adyen
Two end-to-end integrations with Adyen's Checkout platform, built the same way so they can be read side by side. Each one creates a session on the server, renders Adyen's Drop-in v6 in the browser, takes a test-card payment to Authorised, and receives the signed webhook that confirms it.
| Python | Node | |
|---|---|---|
| Repository | test-integration-with-adyen | test-integration-with-adyen-node |
| Server | Flask | Express |
| HTTP client | requests | native fetch |
| HMAC | hmac + hashlib | node:crypto |
| Tests | 16, pytest | 19, node --test |
| Live result | Authorised; AUTHORISATION webhook accepted through a tunnel | Same |
No Adyen SDK in either, on purpose: the request shapes stay visible, which is the point of a sample integration.
What each one does
browser ──POST /api/sessions──▶ server ──POST /v71/sessions──▶ Adyen
browser ◀── { id, sessionData } ── server
Drop-in renders ▶ shopper pays ▶ Adyen ──webhook──▶ server /api/webhooks/notifications
- Sessions flow. The server builds and sends the
/sessionsrequest with the five required fields and surfaces Adyen's error body verbatim when something is wrong, so a422names the field instead of hiding it. - Drop-in v6 from the CDN. No bundler. Every lifecycle callback (
onPaymentCompleted,onPaymentFailed,onError,onChange) is logged to the page, because the silence between "session created" and the first callback is where first-time integrators get stuck. - Webhook verification. HMAC-SHA256 over the eight signed fields, with the
\and:escaping Adyen's libraries do and the docs page does not mention. The verifier matches Adyen's published test vector and is cross-checked against an independent computation in the tests. - Idempotency. Adyen retries until it gets a 200 and can deliver the same event twice. Deliveries are keyed on
pspReference+eventCode; a repeat is acknowledged and recorded as a duplicate, not processed again. The live run exercised this: Adyen delivered the Customer Area test notification four times. - Loud failure. The server boots without credentials; every endpoint that needs one fails naming the missing variable.
The friction log
The reason to build it twice was not the code. It was to keep a log of everything the docs made harder than it should be: 8 findings from reading the docs and 7 from the live run, each with where it happened, what it cost, and the fix.
Status
Done: live payments on both, webhooks through a tunnel on both, duplicate handling verified live. Open: the iDEAL redirect round trip, a refund flow. Each repository's STATUS.md says what is verified and what is not.