Razorpay vs PhonePe Payment Gateway Sandbox: What Test Payments Prove Before Go-Live
A green test run feels like a launch signal. It is not. A sandbox can show that your code handles success, failure and some pending cases. It cannot show whether your merchant account is activated for every method, how real issuers behave or when money lands in your bank. Release managers who treat “all tests passed” as “ready for customers” discover the gap in production.
This guide compares what Razorpay’s test mode and PhonePe Payment Gateway’s UAT sandbox let you rehearse, and sorts every scenario into three groups: sandbox-supported, application-side simulation and live-only. It ends with a release checklist. Facts come from each provider’s public documentation, checked on 30 November 2026.
Quick answer: Razorpay publishes specific test inputs for cards (domestic, international, subscription and EMI) and for UPI success and failure, which makes repeatable test scripts straightforward. PhonePe’s UAT sandbox stands out for its explicit success, failure and pending templates for UPI intent, and outcome selection for UPI QR, cards and netbanking. For teams that need documented card and UPI test inputs plus a clear live acceptance plan, Razorpay is the easier starting point; use PhonePe’s pending templates if you integrate PhonePe. Neither sandbox proves real-world approval rates, settlement timing or refund timing.
Key takeaways
- Keep test and live credentials, records and webhooks fully separate, and never use real customer card data in testing.
- Razorpay: success@razorpay and failure@razorpay simulate UPI outcomes; test cards accept any CVV and a future expiry, then let you choose Success or Failure.
- PhonePe: point Pay and Check Status calls to the sandbox host and choose Success, Failure or Pending templates in the PhonePe Test App.
- Treat any scenario the provider does not document as unverified, and simulate it in your own application instead.
- Plan a controlled live check for activation, issuer behaviour, settlement and refund timing.
How do the two test environments compare?
| Item | Razorpay | PhonePe PG |
|---|---|---|
| Environment | Test Mode with test API keys in the same Dashboard | UAT sandbox; sandbox host for PG Pay and PG Check Status APIs |
| Prerequisites | Razorpay account; Test Mode keys | Merchant ID and UAT credentials from PhonePe; PhonePe Test App on Android, or a Firebase invite for iOS via the integration team |
| Outcome control | Published test inputs and Success/Failure buttons on the sample payment page | Templates mapped to Success, Failure or Pending responses |
| Availability note | Test Mode alongside live account | Sandbox works even when the PhonePe UAT server is unavailable |
| Live switch | Generate Live Mode keys and replace test keys | Complete UAT checklist and go-live process with PhonePe |
Store test and live keys in separate secrets, point test webhooks to a staging URL and label test orders so they never reach fulfilment or accounting.
Which test inputs does each provider publish?
Razorpay test inputs
| Method | Test input | How to get success or failure |
|---|---|---|
| UPI (domestic one-time) | success@razorpay ; failure@razorpay | The UPI ID decides the outcome |
| Domestic cards | Mastercard 5267 3181 8797 5449 ; Visa 4111 1111 1111 1111 | Any CVV, future expiry; click Success or Failure on the sample page |
| International cards | Mastercard 5555 5555 5555 4444 or 5105 1051 0510 5100 ; Visa 4012 8888 8888 1881 | Same as above |
| Subscriptions and EMI | Separate test cards listed on Razorpay’s test card page | Same as above |
Razorpay notes that these cards work only in test mode; using them in live mode returns errors such as an invalid issuer or card input.
PhonePe UAT templates and inputs
| Method | How the outcome is chosen |
|---|---|
| UPI intent (Standard Checkout) | In the PhonePe Test App, enter your Merchant ID, fetch configured templates, select the Custom and Standard Checkout V2 flow and pick Paypage Upi Intent Success, Failure or Pending |
| UPI QR | Scan the UAT QR with a production UPI app (not the Test App), open the link and choose Success, Failure or Pending |
| Cards | Published test credit and debit cards; OTP 123456 on the bank page |
| Netbanking | Redirect page where you pick Success, Failure or Pending |
| UPI collect | Not described on the sandbox page; treat as unverified |
What can each sandbox prove, and what must you simulate?
Split your scenario list into three groups so no one mistakes a simulated pass for a provider-supported one.
| Scenario | Razorpay | PhonePe | Group |
|---|---|---|---|
| Card success and failure | Documented inputs and buttons | Documented test cards and OTP | Sandbox-supported |
| UPI success and failure | success@razorpay / failure@razorpay | Intent templates; QR outcome picker | Sandbox-supported |
| UPI pending | No pending input on the page checked | Paypage Upi Intent Pending template; QR picker | PhonePe sandbox-supported; Razorpay app-side simulation |
| Webhook delayed or missing | Disable or delay your receiver on staging | Same | App-side simulation |
| Duplicate webhook delivery | Replay the same event to your receiver | Same | App-side simulation |
| Fulfilment system fails after payment success | Force your order service to error | Same | App-side simulation |
| Refund | Test refunds in Test Mode where supported | Confirm refund testing with PhonePe | Check per provider |
| Issuer declines, real UPI app behaviour, settlement and refund timing | Not reproducible | Not reproducible | Live-only |
How should you test absent results, failed fulfilment and refunds?
For each case, write down the expected order state, how confirmation is obtained and whether a rerun creates a duplicate order.
| Case | Expected order state | How confirmation is obtained | Duplicate check |
|---|---|---|---|
| Browser closes before redirect | Pending payment | Webhook, then a status API call | Customer retry must attach to the same order or be blocked |
| Webhook never arrives | Pending payment, then resolved by polling | Scheduled status API check (PhonePe Check Status; Razorpay payment or order fetch) | Polling must not create a second order |
| Payment succeeds, fulfilment fails | Paid, fulfilment retry queued | Payment already verified; retry fulfilment only | Retry must not charge again |
| PhonePe pending template | Pending until a final state | Repeated Check Status calls | No second payment request |
| Test refund | Refund recorded against the original payment | Refund API response and webhook | Running the refund twice must be rejected or idempotent |
Webhook signature checks and idempotent processing are the foundation of these tests; our webhook guide covers them. Razorpay’s own testing guidance adds out-of-order events: an older notification must never reverse a completed action.
Release checklist for live-only questions
- Merchant activation: confirm in writing which methods are live on your account. A method that worked in test mode may still need approval.
- Live keys and webhooks: swap credentials, register live webhook URLs and secrets, and remove test values from production.
- Controlled live payments: make small real payments with UPI intent on Android and iOS, a card and any other method you offer.
- Issuer and app behaviour: try at least two banks and two UPI apps; watch for authentication pages and app return.
- Refund: refund one live payment and record when the customer sees it.
- Settlement: match the first settlement to orders, fees and taxes in your books.
- Monitoring: watch declines and pending payments for the first days; our high-value UPI guide covers recovery for pending-after-debit cases.
Why we prefer Razorpay for documented test inputs
- Exact, repeatable inputs: specific UPI IDs and card numbers across domestic, international, subscription and EMI cases let QA write scripts that anyone can rerun.
- Same Dashboard, separate mode: test and live keys come from one account, which simplifies the switch at launch.
- Testing guidance beyond inputs: Razorpay’s published testing guidance covers signatures, duplicate events, timeouts and late authorisation, which maps directly to the checklist above.
Credit where it is due: PhonePe’s explicit pending templates are a real advantage for testing in-flight UPI payments. Sandbox results from either provider do not predict real-world approval rates.
FAQs
1. What is the Razorpay test UPI ID?
Razorpay documents success@razorpay to simulate a successful UPI payment and failure@razorpay to simulate a failure, for domestic one-time payments in test mode.
2. How do I simulate a pending payment in PhonePe’s sandbox?
In the PhonePe Test App, fetch the templates configured for your Merchant ID and select the Paypage Upi Intent Pending template. For UPI QR, scan with a production UPI app and choose Pending from the link.
3. Can I use real cards in test mode?
No. Use only the published test inputs. Razorpay states its test cards work only in test mode, and real customer data should never enter a test environment.
4. Does a passed sandbox test mean my integration is ready for launch?
It means your code handles the simulated cases. You still need merchant activation, live credentials, small live payments, a live refund and settlement reconciliation before full launch.
5. Which sandbox endpoint does PhonePe use?
PhonePe’s UAT sandbox page lists https://api-preprod.phonepe.com/apis/pg-sandbox as the host for the PG Pay and PG Check Status APIs.
6. How do I test a pending payment with Razorpay?
Razorpay’s test card and UPI page publishes success and failure inputs but no pending input. Simulate pending in your own application: hold the webhook on staging, close the browser before redirect and confirm your order stays pending until a status check resolves it.