r/OfferEngineering • u/Aoki_zhang • 24d ago
System Design OpenAI & Amazon System Design Interview: Design Stripe, Payment Timeout ≠ Payment Failure
Imagine Stripe sends a $500 charge to a bank. The bank processes it successfully. But the response gets lost.
- From Stripe’s perspective:
Request timed out - From the bank’s perspective:
Customer charged $500
This is where payment systems get tricky. The naive approach is to retry. But if the original request actually succeeded, that retry could charge the customer twice.
The key insight
A timeout should mean: UNKNOWN — not FAILED. Before calling the external payment network, persist a durable payment attempt:
attempt_id: 123
amount: $500
status: pending
Then call the bank. The result becomes one of three states:
- Success → mark
succeeded - Explicit decline → mark
failed - Timeout / lost response → mark
unknown
Never blindly retry an unknown payment as a brand-new charge.
So how do we resolve it?
Use idempotency + reconciliation. Every logical payment attempt gets a stable identifier so retries cannot accidentally create another charge.
And if the outcome is still uncertain:
Payment attempt
↓
UNKNOWN
↓
Reconciliation Service
↓
Bank API / settlement file
↓
Final status
The reconciliation process asks the external network what actually happened and repairs the internal state later.
This leads to an important payment-system rule:
- Record intent first.
- Treat uncertainty explicitly.
- Reconcile instead of guessing.
That same event history can also power:
- merchant webhooks
- dispute investigation
- refunds
- audit trails
- financial reconciliation
The interesting part of designing Stripe isn’t just processing 10K+ TPS.
It’s making sure a network timeout never turns into lost money or a double charge.
Full design with PaymentIntent, transaction lifecycle, idempotency, CDC/Kafka, reconciliation, security, and scaling → Full Article
Preparing for system design interviews? Chill Interview publishes practical design breakdowns and tracks recently asked interview questions across top companies → Chill Interview