Payment Checkout & Ledger Service  ·  View 02 of 24  ·  Context and scope

High-Level Architecture

The six stages a payment passes through, and which of them the buyer is waiting on.

Editable source SVG draw.io All views
Accept API edge Envoy · mTLS Idempotency store Redis · 24 h keys Authorize Intent service state machine Routing policy engine versioned rules Provider adapters circuit broken Record Durable event log Kafka · ordered Ledger poster double entry Ledger PostgreSQL · append only Resolve Callback ingest signed · deduped Outcome poller processing > 60 s Settlement matcher daily files Notify Webhook delivery 72 h retry Balance projections rebuildable Pay out Payout engine T+1 · 06:00 Statements trial balance events outcomes fan-out breaks High-Level Architecture — From Tap to Trial Balance Interface / broker Data store Application we own Queue / topic event / async batch The buyer's answer comes from Accept + Authorize alone. Everything right of the event log is allowed to be slower than the buyer, and the payout run reads the ledger rather than the payment state. v 1.0 · owner Payments Platform Architecture · date 2026-10

Decisions

  • The buyer's answer is produced by Accept and Authorize alone. Record, Resolve, Notify and Pay out are all downstream of a durable log (ADR-01).
  • Routing is a versioned policy evaluated per attempt, and the version used is stored on the attempt — so a decision is reproducible years later (ADR-06).
  • The settlement matcher, not the provider's synchronous answer, is the evidence of what happened (ADR-05).

Numbers

  • 420 attempts/second steady, 4,000/second for 10 minutes at a sale peak; 12 M attempts/day.
  • Intent create p99 ≤ 120 ms; confirm excluding provider p99 ≤ 250 ms; provider deadline 8 s hard.
  • Ledger posting p99 ≤ 2 s after a terminal event. All figures are stated assumptions.

Deliberate omissions

  • Merchant onboarding, KYC and pricing configuration: a separate platform that writes merchant records this service reads.
  • The sandbox estate mirrors this diagram with simulated providers and is not drawn again.