Scenario
Design a payment system that supports:
-
Hold payment (authorization)
: Place a temporary hold on a customer’s payment method for a given amount.
-
Batch process funds (settlement)
: Capture/settle authorized holds in batch (e.g., end-of-day) and move funds to the merchant.
-
Charge payment (direct charge)
: Charge immediately (auth + capture) when batching is not desired.
The system must be reliable, idempotent, and auditable.
What to cover
-
APIs and core data model
-
End-to-end flows (hold, capture/batch settlement, direct charge, cancel/release hold, refunds)
-
Consistency guarantees and failure handling
-
Idempotency strategy
-
Handling duplicates, retries, partial failures
-
Observability and reconciliation
-
Security/compliance considerations (high level)