Your Cart
Loading

SaaS Checkout + Webhook Starter — Node 22, 5 tests passing

On Sale
$49.00
$49.00
Added to cart

Most self-built checkouts are broken in the same three places: the webhook is accepted without signature verification, a retried webhook creates a second order, and the success page is shown before the payment is confirmed. This starter has all three handled, with tests that prove it.

Seven files of Node 22 code, no framework, no build step: a checkout handler, a webhook receiver with signature verification and idempotency, a small file-backed store, an .env example, and 5 tests that pass with `node --test test/*.test.js`.

Copy the two handlers into your app and change the gateway call.


What is inside

• server.js — HTTP server: /checkout, /webhook, /return

• pay.js — payment gateway adapter with an injectable fetcher, so tests run offline

• store.js — order store with idempotency keys (no duplicate order on retry)

• test/pay.test.js — 5 tests: signature reject, duplicate webhook, amount mismatch, retry, success

• .env.example and README.md — the operating checklist: what to log, what never to log, replay window, refund path


Delivery: instant download after payment. Refund within 7 days — reply to the receipt email.

Support: contact@intelliliving.kr

You will get a ZIP (6KB) file