How sandbox works
When you use ask_test_ API key, PayBridgeNP automatically uses built-in test credentials for each provider. You don’t need to configure anything in the Providers section.
API keys in sandbox mode start with sk_test_.
Built-in test credentials
PayBridgeNP manages sandbox provider credentials platform-side, so you don’t enter merchant keys for eSewa or Khalti when usingsk_test_. Fonepay is different: it has no test environment, so sandbox-mode Fonepay uses your own real Fonepay merchant credentials and moves real money. PayBridgeNP caps it at NPR 1,000 per payment and NPR 5,000 per month to keep test costs small - test with tiny amounts like NPR 10.
The buyer-side test logins you’ll need to complete a sandbox payment are listed under each provider below.
Running a test payment
1
Use your sandbox API key
In the dashboard, go to Settings → API Keys and copy a key that starts with
sk_test_. Use this key in your server. Sandbox mode is determined by the key, not a project toggle.2
Create a test checkout session
3
Pay with eSewa test account
On the checkout page, select eSewa. You’ll be redirected to eSewa’s sandbox (
rc-epay.esewa.com.np).Use these test credentials:- eSewa ID:
9806800001through9806800005 - Password:
Nepal@123 - MPIN:
1122 - Token/OTP:
123456
4
Pay with Khalti test account
On the checkout page, select Khalti. You’ll be redirected to Khalti’s sandbox (
dev.khalti.com).Use these test credentials:- Khalti ID:
9800000001through9800000005 - MPIN:
1111 - OTP:
987654
5
Pay with Fonepay (real money, capped)
On the checkout page, select Fonepay. A Dynamic QR code is displayed - it refreshes every 3 minutes until paid or the session expires.Scan the QR with any Nepali bank app, exactly as a live buyer would. The payment is confirmed in real time via WebSocket - no page refresh needed.
6
Check the result
After payment, you’re redirected back to your
returnUrl. Check the Payments tab in the dashboard - the payment should appear with status Succeeded.If you have a webhook configured, check Webhooks → Delivery Log to confirm the event was delivered.Going live
When you’re ready to accept real payments:- Go to Settings → API Keys in the dashboard
- Copy your live key (starts with
sk_live_) - Go to Providers and add your real eSewa, Khalti, and Fonepay credentials (see Provider Setup)
- Update your server to use the
sk_live_key
sk_test_ to sk_live_ switches all API calls to live mode. No project toggle required.
Sandbox limitations
- Sandbox payments do not appear in your eSewa or Khalti merchant dashboard - they’re simulated end-to-end within PayBridgeNP
- Fonepay has no test environment - sandbox Fonepay uses your real merchant credentials and moves real money (capped at NPR 1,000 per payment, NPR 5,000 per month). Payments appear in your real Fonepay merchant panel
- Webhook delivery works normally in sandbox - your webhook URL must be publicly reachable. Use ngrok or Cloudflare Tunnel for local testing