tfpdev

Where moneygoes missing.

Every way a payment system loses money, as a game you can break and an article that shows the real fix.

01ConcurrencyArticle →

Double-spend

A $100 balance. Fire payments at it faster than it can count.

Never existed$0
02IdempotencyArticle →

Retry storm

The phone lost signal and retried. The customer bought one ticket.

tap to buy
Buy one ticket. The signal is bad.
03Money mathArticle →

Ten cents

Add 10¢ a thousand times in floating point. Count how often the total is wrong.

hold to pour dimes
Drop a dime in the jar. Then another.
04State machineArticle →

Refund twice

The button was disabled in the UI. The API was not.

tap to refund
Pay first. Then have both agents refund.
05LedgerArticle →

The scale

Two UPDATEs. The server dies between them.

tap to pay $30
Pay a few times. Then crash.
06WebhooksArticle →

Late mail

Providers deliver events late, twice and out of order. You pick the order.

Deliver envelopes in any order. Make the paid order look unpaid.
07Money mathArticle →

Split the bill

$100 three ways. Where does the last cent go?

Split the bill. Watch the last cent.
3 ppl
08ConcurrencyToy only

Two workers

The payout job was slow, so someone ran a second copy.

tap to run the job
$300 due to six people. Run the job.
These are toys

The real versions hit a real database.

Same bugs, run against Postgres with real transactions, real locks and the SQL on screen.

Read the articles