Skip to content
StackDecode
System Design
20. System Design Case StudiesAnimated

Online Payment Gateway (Stripe)

Take payments reliably.

The idea

Idempotent APIs, a ledger, fraud checks and integration with card networks.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

MerchantAPI (idempotent)LedgerCard network / …Webhooks
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

The merchant creates a payment with an idempotency key.

step:
1/4
at:
Merchant
1/9

The green dot is a request moving through the system.

Step by step

  1. 1Client submits a payment with an idempotency key
  2. 2Run fraud checks
  3. 3Authorise with the bank
  4. 4Record in the ledger and notify

Where it is used

Financial design.

Watch out for

Never lose or double-charge. Use idempotency and a ledger.

Related