Menu

1 / 3

Building Production Subscriptions with Razorpay: Webhooks, Signatures, and Edge Cases

DEV Community: fastify·Sanjay Singh·about 23 hours ago
#TU9yhakq
#devtofastify#devto#dev#fullscreen#razorpay
Reading 0:00
15s threshold

If you have integrated Stripe before, you might expect payment gateways to behave consistently: create a customer, attach a payment method, subscribe them to a price ID, and listen for customer.subscription.updated webhooks.

When you integrate Razorpay for the Indian market, that mental model breaks almost immediately.

Between Reserve Bank of India (RBI) e-mandate regulations on recurring card transactions, asynchronous webhook delivery delays, cryptographic signature quirks where parameters are silently inverted between endpoints, and Fastify/NestJS stream parsing bugs, getting Razorpay to run reliably in production requires defensive engineering that the official documentation barely touches.

In this guide, we break down the exact production architecture we built for ZyVOP: a dual-mode subscription engine in NestJS and Fastify that handles recurring e-mandates, falls back to fixed-term orders when cards fail, enforces constant-time signature verification, and guarantees idempotent webhook…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.