25 November 2026
Most payment bugs don't happen when the payment succeeds.
They happen in the webhook.
Here's the checklist I use, after building LocalPay, an open-source Razorpay emulator:
- Verify the signature on the raw body, before parsing JSON
- Assume every webhook arrives twice. Store the event id
- Don't trust the order. order.paid can arrive before payment.captured
- Make your own API calls idempotent. A timeout doesn't mean it failed
- Reply fast, do slow work in a background job. Slow replies cause retries
- Test the ugly cases: UPI timeout, bank down, late authorisation
Most teams only test #1 and the happy path.
Then a customer gets charged once and emailed three times.
Which of these has bitten you in production?
#Payments #Backend #Fintech