Payment gateway design part 2: 9-step flow and explicit state machine
goyalshaliniuk · x · 2026-12-06
Part 2 of the 'design a Stripe-like payment gateway' series, covering a reliable payment processing workflow.
9-step flow: customer initiates → merchant sends request → API gateway authenticates → payment service validates → fraud detection evaluates risk → orchestrator selects processor → processor talks to banking network → system records result and updates status → merchant receives final status via API/webhook.
Example states: CREATED, REQUIRESACTION, PROCESSING, AUTHORIZED, CAPTURED, FAILED, CANCELLED, REFUNDED. Not every payment follows the same path: some require additional customer authentication, others are declined or remain pending. Explicit states make workflows easier to debug and trace.
Related event: Engineering a Stripe-Style Payment Gateway: Architecture Deep Dive(2 posts)→
More from coding & agent
- Qwen4 35B hits 149 tok/s with MTP on a 24GB RTX 5090 laptop — a full local AI stack — AIFlow_ML · 2026-12-06
- Personal sites are the best GEO play: define how AI agents see you, argues Guizang — op7418 · 2026-12-06
- Google Antigravity's /swarm splits tasks across parallel agents with a verifier checking the work — Saboo_Shubham_ · 2026-12-06
- Guizang rebuilds his personal site with multiple models, powered by his agent memory project — op7418 · 2026-12-06
- KOL revisits take: Skills are an open plot to absorb long-horizon tasks for training — vista8 · 2026-12-06
- 20 concepts to learn before building agentic AI, from Python to orchestration — atullchaurasia · 2026-12-06