Test vs Live Mode
Understanding the difference between Razorpay's Test and Live environments, and which test credentials to use for every payment method.
This is the most important concept to understand before writing a single line of payment code. Getting this wrong — using Live credentials in development, or accidentally testing with real card numbers — can have real financial consequences.
The Core Distinction
| Aspect | Test Mode | Live Mode |
|---|---|---|
| API key prefix | rzp_test_ | rzp_live_ |
| Real money moves | No | Yes |
| Customer's card charged | No | Yes |
| Bank settlement | No | Yes (T+3) |
| Dashboard environment | Separate Test view | Separate Live view |
| KYC required | No | Yes |
| Test card numbers work | Yes | No |
| Available from day 1 | Yes | Only after KYC approval |
Think of Test Mode as a flight simulator. Every control, every instrument, every response is real — but the plane never leaves the ground. You can crash a hundred times, fix the problem, and walk away. Live Mode is the actual flight.
The CA Analogy
You already work with this concept in accounting:
- Test Mode is like a dummy client ledger you create to test your accounting software's new features before the financial year opens. Same software, same interface, zero actual impact.
- Live Mode is the actual client's books. Every entry has real consequences.
In CA practice, you never test in a client's live books. The same discipline applies here.
Switching Between Modes
In the Razorpay Dashboard, the Test Mode / Live Mode toggle is at the top right of the screen. It looks like a small switch with a label. Click it to switch views.
Important: switching in the dashboard does not affect your application. What affects your application is which API keys you use in your .env.local file. Test keys only talk to the Test environment. Live keys only talk to the Live environment.
Test Credentials for Every Payment Method
Razorpay provides specific test credentials for each payment method. Use these during development — do not use real card numbers or real UPI IDs.
Test Card Numbers
| Card Type | Number | CVV | Expiry |
|---|---|---|---|
| Visa (success) | 4111 1111 1111 1111 | Any 3 digits | Any future date |
| Mastercard (success) | 5267 3181 8797 5449 | Any 3 digits | Any future date |
| Rupay (success) | 6073849700004947 | Any 3 digits | Any future date |
| Amex (success) | 3714 496353 98431 | Any 4 digits | Any future date |
| Any card (failure) | 4000 0000 0000 0002 | Any 3 digits | Any future date |
| 3D Secure (OTP) | 4111 1111 1111 1111 | Any 3 digits | Any future date + any OTP |
For cards that trigger a 3D Secure OTP, use any 6-digit number as the OTP in Test Mode. Razorpay accepts any value during testing. In Live Mode, the OTP comes from the customer's actual bank via SMS.
Test UPI IDs
| UPI ID | What it simulates |
|---|---|
success@razorpay | Successful UPI payment |
failure@razorpay | Failed UPI payment |
pending@razorpay | UPI payment stuck in pending state |
Use these in the "UPI ID" field when the Razorpay modal opens during development. Do not use your real GPay or PhonePe UPI ID.
Test Net Banking
In Test Mode, when you select Net Banking in the Razorpay modal, all banks are simulated. Select any bank, and you land on a test page that asks you to mark the payment as Success or Failure. Choose accordingly.
Test Wallets
In Test Mode, wallets are pre-loaded with test balance. Any wallet payment will succeed without requiring a real wallet login.
Environment Variable Strategy
Your project uses different credentials in different environments. Never mix them.
Development (.env.local):
Edge Function secrets (Supabase — set per environment):
Vercel (for the frontend Key ID only) has separate Environment tabs: Development, Preview, Production. Set the test Key ID on Development/Preview, the live Key ID on Production. Never expose the Key Secret to Vercel — it belongs only in Supabase secrets.
The Production Cutover Checklist
When you are ready to switch a client project from Test to Live, this is the complete checklist. Do not skip steps.
| Step | Action | Why |
|---|---|---|
| 1 | KYC approved in Razorpay | Required before live keys are issued |
| 2 | Generate Live Mode API keys | They only appear after KYC approval |
| 3 | Save live keys to VaultMate | Immediately — the Key Secret shows only once |
| 4 | Add live Key ID to Vercel Production environment | Frontend uses it for the checkout modal |
| 5 | Add live Key ID and Secret to Supabase Production secrets | Edge functions use them for order creation and verification |
| 6 | Update webhook URL if needed | Live and Test webhooks are separate in Razorpay |
| 7 | Run one real ₹1 transaction end-to-end | Confirm money moves, verify it appears in Live dashboard, confirm bank account receives settlement |
| 8 | Check settlement settings | Confirm your bank account is linked and settlement is enabled |
Never commit live API keys to Git. They belong only in .env.local (gitignored), Supabase secrets, and VaultMate. If a live key is accidentally committed: regenerate it immediately in the Razorpay dashboard, save the new key everywhere, and rotate it in any deployed environment.
Common Mistakes
Using Test Mode keys in production Your checkout modal will open, customers will enter real card details, and Razorpay will reject every payment with "invalid key" or process it as a test transaction with no money moving. You will have confused customers and an empty settlement account.
Using real card numbers in Test Mode Real card numbers are rejected in Test Mode — Razorpay validates that only test numbers are used in the test environment. But more importantly: never enter real card numbers into any development system you are building. It is a security risk and a PCI compliance violation.
Checking the wrong dashboard You run a test payment, open the Razorpay dashboard, and cannot find the order. You are probably looking at the Live Mode dashboard when your payment went to Test Mode. Always check the mode toggle in the top right before concluding that something "didn't work."
rzp_test_. If it does, your environment is correctly set up for development. Keep this tab open when you write your first payment integration — the Order history in Test Mode will show every test transaction you trigger.