Why Razorpay?
Razorpay is India's most developer-friendly payment gateway. It supports UPI, Net Banking, Credit/Debit cards, EMI, and digital wallets — covering virtually every way an Indian customer wants to pay.
How the Integration Works
- Create an Order — your server calls Razorpay's API to create an order object with the amount and currency.
- Open Checkout — your frontend loads the Razorpay checkout popup using the order ID.
- Verify Payment — your server verifies the HMAC signature to confirm it's genuine.
Always create orders server-side — never trust the client to set the amount.
Payment Verification (Critical!)
After the user pays, Razorpay calls your handler with razorpay_order_id, razorpay_payment_id, and razorpay_signature. Always verify the signature on your server using HMAC-SHA256. Never trust client-side confirmation alone.
Webhooks
Set up webhooks to handle async events like payment failures, refunds, and disputes. This ensures your orders stay in sync even if a user closes the browser mid-payment.
Going Live
- Switch from
rzp_test_keys torzp_live_keys - Complete KYC on the Razorpay dashboard
- Test with small live transactions before full launch
Need help? Our e-commerce team has integrated Razorpay into 20+ projects. Contact us to get started.