Case Study
The Money Was Coming In. Nobody Knew Where It Was Going.
How I made every payment log itself automatically — fees, net amount, and all — so the daily copy-paste ritual disappeared and the numbers were always right without anyone checking.
Razorpay was working fine.
Payments were processing, customers were being charged, the money was landing in the account. From the outside, the payment side of the business looked completely healthy.
But inside the operation, nobody actually knew which orders were paid, which weren't, what the real net amount was after fees, or whether every transaction had been accounted for. The accounting software knew. The ops sheet didn't. And the ops sheet was what the team lived in every day.
So every morning, someone sat down and manually connected those dots. Razorpay dashboard on one screen, Google Sheet on the other. Copy, paste, calculate, update. Repeat for every order.
And at the end of the month, reconciliation — hours of cross-checking to make sure nothing slipped through. Still never fully confident the numbers were right.
What I Built
The moment Razorpay confirms a payment, the system wakes up.
First thing it does — verify the webhook signature using HMAC-SHA256. Every Razorpay event is cryptographically signed. If the signature doesn't match, the request gets dropped immediately. No exceptions. Fake payment confirmations don't get through.
Then it finds the matching WooCommerce order. This sounds simple but there's a real edge case here — Razorpay sometimes fires the webhook before WooCommerce has fully created the order. A naive system fails here and moves on silently. This one retries. 15 seconds. Then 30. Three attempts before it gives up and alerts the admin. In practice it almost never reaches attempt three.
Once the order is matched, fees get calculated automatically — the gateway percentage, the GST on that fee, the actual net amount the store receives. All of it logged to a settlement sheet without anyone touching it.
The ops sheet gets updated. The customer gets a WhatsApp confirmation. Done, in seconds.
Failed payments work the same way — card declined, bank error, UPI timeout, whatever — the customer gets a WhatsApp message immediately asking them to retry. Most stores do nothing here. That's a recoverable sale just walking out the door.
And every day, a reconciliation job runs in the background. It calls Razorpay's reconciliation API directly, pulls every transaction for that period, and cross-checks against the ops sheet. Anything that's in Razorpay but missing from the sheet gets flagged for review. Nothing falls through the cracks — not even the edge cases the real-time system missed.
What Changed
The morning reconciliation ritual disappeared. The monthly cross-checking disappeared. The quiet anxiety about whether the numbers were actually right — disappeared.
Every payment, logged automatically. Every fee, calculated automatically. Every gap, caught automatically.
The team stopped managing payments and started just running the business.
If your ops sheet and your payment gateway are living in completely different worlds, that's a fixable problem. Let's talk.