Advanced Walkthrough: A Payment System

System Design · Advanced Walkthroughs · Master · 32 min

Design a payment system that never charges twice and never loses a cent: idempotency keys, a payment state machine, a double-entry ledger, safe retries against external card processors, and nightly reconciliation, then code an idempotent ledger.

This lesson is part of TuringPath Pro. See plans.

What you will learn

  • 1. Requirements and numbers
  • 2. API and data model
  • 3. High-level design
  • 4. Deep dive: idempotency keys and the state machine
  • 5. Deep dive: double-entry ledger, retries and reconciliation
  • 6. Trade-offs and failure modes

More in Advanced Walkthroughs

Previous: Advanced Walkthrough: A Dynamo-style Key-Value Store · Next: Advanced Walkthrough: A Collaborative Editor (Google Docs)