Facebook Pixel

What test cards should I use with Razorpay?

Visa success: 4111 1111 1111 1111. Mastercard success: 5104 1111 1111 1111. Visa failure: 4111 1111 1111 1112. Use any future expiry date and any 3-digit CVV. For UPI, use success@razorpay (success) or failure@razorpay (failure).

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Testing and Debugging Razorpay Payments in Node.js Test Mode and Error Handling

Use test mode with rzp_test_ keys. Use test card 4111 1111 1111 1111 (Visa) with any future expiry and any CVV for success. For UPI, use success@razorpay. No real money is charged. Test all payment methods, failures, and webhooks before going live.

Use ngrok to expose your local server: ngrok http 3000. You get a public HTTPS URL. Set this URL as the webhook URL in the Razorpay dashboard. Now Razorpay can send webhooks to your local server for testing.

Common causes: using express.json() instead of express.raw() for the webhook route (the signature is on the raw body), different webhook secret in .env vs the dashboard, or body parsing modifying the content. Use express.raw({ type: 'application/json' }) for the webhook route.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0