A shop asks the payment service to take money. The service asks the bank to charge the card, then writes the payment in its ledger, which is its own list of money moved. Lose the bank's answer, or crash the service, and watch whether the two still agree.
Try it
Speed
Lab time 3.0 s
Shop checkout — 8 payments a second — healthy — 0 turned away
Payment service — sends a key each time — healthy — 2 with no answer yet
Bank — took $627 — healthy — 15 charges
Ledger — shows $627 — healthy — 15 payments
Reconciliation — every 5 s — healthy — 0 put right
A payment, or a charge sent to the bank
An answer
A row written in the ledger
Reconciliation asks the bank
An answer that was lost, or a payment turned away
Paid
15/ 17
payments charged and in the ledger
Charged twice
0
$0 taken that nobody owed
Taken with no record
0
$0 charged, no ledger row
Tried again
0
no answer in 1 s, so asked again
Put right
0
by the reconciliation job
Turned away
0
arrived while the service was down
Numbers add up:15 bank charges = 15 ledger rows + 0 charged twice + 0 with no row yet · $627 at the bank = $627 in the ledger + $0 charged twice + $0 with no row yetThe lab checks this sum as it runs, so a counting mistake would show here.
Controls
Payments by state
State
Payments
What it means
Charging
2
The bank was asked. The service has no answer yet.
Paid
15
The bank took the money, and the ledger shows it.
Declined
0
The bank said no. No money moved.
Unknown
0
No answer after 3 tries. Nobody knows whether the bank took the money.
Failed
0
Reconciliation asked the bank, and the bank had taken nothing.
The bank has taken $627 and the ledger shows $627. The two agree.
Money the bank has taken that the ledger does not show ($)
012.52537.5501s2s3s
Show data table
Time
Bank ahead of ledger
1s
0
1s
0
2s
0
2s
11
3s
44
3s
0
What just happened
Nothing yet. Start traffic or run an experiment.
What this model simplifies
A payment here is one step: charge the card. Real card payments first hold the money, then take it later, and can be refunded.
The ledger has one row for each payment. A real ledger writes two rows for each move of money, one for each side, so that they sum to zero.
The service asks at once when 1 s have passed. Real services wait longer before each new try.
Reconciliation runs every 5 s and asks about one payment at a time. Real jobs compare a whole day's file from the bank, often hours later.
Reconciliation here repairs payments left without an answer. A real job also finds a second charge for one payment and gives the money back.
A crashed service is back after 2 s and its database keeps every payment row. Only what it held in memory is gone.