The tiny local UPI simulator that stopped my nightly payment-testing chaos

I built a lightweight local UPI/payment simulator to run reliable end‑to‑end tests on my emulator and phone without using staging or burning mobile data. Here's what I actually built, why it worked, and where it failed.

Written by: Arjun Malhotra

Laptop on a wooden desk showing code editor on screen, with a coffee cup and phone nearby
Photo by Annie Spratt on Unsplash

It was 10:40pm and I was demoing a UPI payment flow to my PM over a flaky home Wi‑Fi connection. The Android emulator kept timing out waiting for a PSP callback; the app showed “pending” because our staging bank had queued the message. I wasted twenty minutes trying to coax a test transaction through, then restarted the emulator, and restarted my laptop, and finally gave up.

That was the night I decided “staging” and “real PSPs” were not the right tool for the hundred little developer iterations I do every week. I needed a tiny, local thing that behaved like a payment backend: predictable, fast, and usable offline so I could iterate without burning mobile data or waiting for bank queues.

What I built (in 3 evenings)

Why this is boringly useful

How I integrate it into normal dev flow

A concrete example — mapping device to laptop

The one honest failure (and why it matters) A month in, a release candidate failed certification. Our PSP insisted on RSA-signed callbacks and a very specific canonical string format that my simulator didn’t produce. The mobile app passed all my local tests but failed with the real PSP because the signature algorithm and timestamp rounding mattered. I had glossed over signature verification during the simulator build because it felt like a delivery detail — a mistake.

The fallout: we still use the simulator for day-to-day dev and UI tests, but any change touching crypto, signature formats, or settlement behaviour goes to staging with the real PSP. The simulator is now explicitly documented as “API-compatible but not signature-authentic” and we added a final gating job that runs against the actual PSP sandbox with signed messages.

Tradeoffs I accepted

Why this fits Indian dev constraints

Concrete tips if you want to try it

What I walked away with Mocks are not a replacement for staging, but a focused local simulator cut the daily friction by an order of magnitude. It turned payment testing from a stressy, late‑night chore into a five‑minute feedback loop. The tradeoff is obvious: you still must test crypto and settlement against real systems. But for the 95% of development where you’re iterating on UI and happy‑path flows, a tiny local simulator is the pragmatic win.