How do you architect a UPI payment processing pipeline to ensure zero double-debits under network timeouts?
Write your answer first
Saved on this device only — nothing is uploaded.
Reveal model answer & level guide
In UPI payment processing, a transaction is an asynchronous, multi-hop state machine involving the Merchant App, PhonePe Switch, NPCI UPI Common Platform, Remitter Bank, and Beneficiary Bank. Network timeouts are common. To guarantee zero double-debits, every transaction initiates with a globally unique, cryptographically random idempotency key. State transitions follow an immutable saga pattern. If an NPCI response times out, the transaction enters an asynchronous PENDING state; background reconciliation workers poll the bank status API rather than blindly re-triggering debit calls.
- Entry
- Outlines the steps of a UPI transaction and why timeouts occur.
- Mid
- Explains idempotency keys, pending states, and webhook callbacks.
- Senior
- Architects distributed saga patterns, zero-double-debit guarantees, and automated bank reconciliation engines.