What this is
A small payment processor, shaped like Stripe. It holds its own ledger in its own database and
is reachable only over HTTP, because the network between a merchant and its processor is the entire reason
idempotency keys and retries exist.
The idempotency layer, live
Send the same request twice with the same key. A processor that merely refuses the second one
is not enough: the caller lost the first response, so it needs the same answer again.
first call
not run yet
retry, same key
not run yet
Three cases, and the difference between them is the point. Same key and same request returns
the byte-identical response. Same key with a different request returns 422, because that is a caller
bug and silently doing either thing would be worse. Same key while the first is still running returns 409.
Payment intents
Authorised money is held, not earned. It becomes the merchant's only on capture, and goes
back to the customer on cancel.
Idempotency keys seen
The processor's own record of every key, its request fingerprint, and the status it returned.