Skip to main content

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.

PythonNode
Repositorytest-integration-with-adyentest-integration-with-adyen-node
ServerFlaskExpress
HTTP clientrequestsnative fetch
HMAChmac + hashlibnode:crypto
Tests16, pytest19, node --test
Live resultAuthorised; AUTHORISATION webhook accepted through a tunnelSame

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 /sessions request with the five required fields and surfaces Adyen's error body verbatim when something is wrong, so a 422 names 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.