Skip to content
Batıhan Özdemir.

Payment demo

A small payment system I built. It takes test purchases by test card and on a test network, follows each payment from checkout to a single ledger, and tells the shop when the order is paid. It runs on test money only.

Two ways to pay

Both rails end in the same ledger.

TEST CARD

Runs onStripe test mode
Pays withA saved test card
Settles onA signed webhook
No webhookA job asks Stripe

Nobody enters card details. Only test keys are accepted.

TEST NETWORK

Runs onBase Sepolia (test)
Pays withTest USDC
Matched byIts unique amount
Settles after10 confirmations

Test tokens only. No real money moves.

How a payment moves

The stages a payment goes through on each rail.

Test network
  1. Sent
  2. Received
  3. Confirming n/10
  4. Settled
  5. Shop notified
Test card
  1. Sent
  2. Processing
  3. Settled
  4. Shop notified
Failed
  1. Did not go through

Sent
The demo sends the payment: a transfer, or a card charge.
Received
The tracker sees the transfer on the test network.
Confirming
New blocks are built on top; the payment waits for 10.
Processing
Stripe is working on the card charge.
Settled
One entry is written to the ledger.
Shop notified
The shop gets a signed notice that the order is paid.
Did not go through
A declined test card, or a transfer that can never land. Nothing is credited.

What makes it reliable

  1. Idempotent chargesEach card charge carries a key made from its order, and a retried transfer resends the same signed one, so nothing is paid twice.
  2. Signed webhooks, handled onceStripe webhooks are accepted only with a valid signature, and an event that arrives again changes nothing.
  3. ReconciliationWhen a webhook never comes, a job asks Stripe for the payment and applies the answer the same way.
  4. Confirmations and reorgsA network payment settles after 10 confirmations; if its block is replaced before then, it goes back and is tracked again.
  5. One ledgerCard and network payments share one ledger, with one entry per payment.
  6. Limits and a daily budgetVisitor purchases have per-visitor and daily limits, and scheduled purchases stay within a daily budget, so the demo runs on free test services at no cost.

The demo right now

Real test payments from the running demo: figures for today, settle times for two weeks and the latest receipts.