stackbook.io
🔍
← Back to Syllabus
Day 9Level 1 — Core Mental Models

Design Brief: Payment System — Idempotency & Delivery Guarantees

Learn: 45 minMap: 35 minDesign: 70 min

Core Concepts (5)

  • 1.Payments require: idempotency, audit trail, reconciliation, exactly-once settlement
  • 2.Outbox pattern ensures DB + message atomicity for payment events
  • 3.Reconciliation jobs catch drift between systems
  • 4.PCI DSS constraints shape architecture — tokenization, encryption, scope reduction
  • 5.Webhook idempotency: provider retries must not double-charge

Map to Your Experience

You're building a payment service. A user clicks "Pay" twice rapidly. Trace what happens in your system. Where could double-charge occur?

Design Brief: Payment System — Idempotency & Reconciliation

Requirements

  • •Process payments with idempotency keys
  • •Handle provider webhooks idempotently
  • •Support refunds and partial captures
  • •Daily reconciliation with provider statements
  • •Audit trail for every state transition

Constraints

  • •PCI DSS SAQ-A compliance (tokenization only)
  • •p99 latency < 2s for payment initiation
  • •Zero data loss — all events persisted
  • •Provider API: at-least-once webhook delivery

Must Cover

idempotency-keysduplicate-handlingdelivery-guaranteesdata-correctnessreconciliation

Trade-off Axis

simplicity vs correctness

Competencies Advanced

data state → L3reliability ops → L3security compliance → L2

Ready to Design?

Open this day in the Design Studio. The studio follows this track: its days, concepts, patterns and trade-offs are loaded, and you keep one design across the whole track.

Open in Studio →