Skip to main content
Sandbox mode gives eSewa and Khalti test environments for the complete checkout, callback, and webhook flow. Fonepay has no test environment and is the real-money exception explained below.

How sandbox works

When you use a sk_test_ API key, PayBridgeNP uses built-in test credentials for eSewa and Khalti. You do not configure those providers for sandbox testing. Fonepay requires your own merchant credentials. API keys in sandbox mode start with sk_test_.

Built-in test credentials

With sk_test_, eSewa and Khalti need no keys: we provide the sandbox accounts. Fonepay has no test environment, so test-mode Fonepay uses your real Fonepay merchant details and moves real money. It is capped at NPR 1,000 per payment and NPR 5,000 a month; 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: 9806800001 through 9806800005
  • 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 test checkout (test-pay.khalti.com).Use these test credentials:
  • Khalti ID: 9800000005 (recommended). Khalti’s test wallets are shared by every integrator, and 9800000001 to 9800000004 are often drained or return “insufficient balance”, “similar request already being processed”, or a 400 error. Those messages come from Khalti’s sandbox, not from your integration.
  • 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; no page refresh needed.
Fonepay has no test environment. Sandbox-mode Fonepay runs against the real Fonepay network with your own merchant credentials (configured in your project’s Providers settings), and the money moves for real. PayBridgeNP caps sandbox Fonepay at NPR 1,000 per payment and NPR 5,000 per month - keep test amounts tiny (NPR 10 works fine).
6

Pay with a test card (preview, test mode only)

On the checkout page, enter a mobile number or email (for the receipt), then select Card. The card fields open on the PayBridgeNP checkout page (secure fields from our card processor). The buyer’s name is filled in if the checkout has one; otherwise the form asks for it.Use these test cards, with any future expiry date and any CVV:
  • Visa, approved straight away: 4000 0000 0000 2701
  • Visa, with a bank check: 4000 0000 0000 2503. Enter 1234 on the test bank page.
  • Mastercard, approved straight away: 5200 0000 0000 2235
It shows in your dashboard as a Card payment and sends payment.succeeded like any other. Refund it, in full or in part, from the payment’s page. A card refund shows Submitted until the simulated bank batch confirms it, with no fixed time. To hide Card from test checkouts, switch it off under Payment providers in test mode.
Card payments are a test-mode preview only; live checkouts never show Card. They run on a shared PayBridgeNP test account, limited to NPR 1,00,000 per payment and 50 card attempts a day per merchant. The card form opens as a full page on the PayBridgeNP checkout address, not in an embedded checkout or on a custom domain.
7

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:
  1. Go to Settings → API Keys in the dashboard
  2. Copy your live key (starts with sk_live_)
  3. Go to Providers and add your real eSewa, Khalti, and Fonepay credentials (see Provider Setup)
  4. Update your server to use the sk_live_ key
That’s it. Swapping the key from sk_test_ to sk_live_ switches all API calls to live mode. No project toggle required.
Live keys process real payments. Make sure your provider credentials are from the production environment - not eSewa’s RC environment or Khalti’s dev environment.

Sandbox limitations

  • Sandbox eSewa and Khalti payments do not appear in your eSewa or Khalti merchant dashboards.
  • Fonepay has no test environment: test-mode Fonepay moves real money and shows in your real Fonepay merchant panel. Capped at NPR 1,000 per payment and NPR 5,000 a month; an unpaid test QR can count towards the monthly cap for a short time, even if replaced or never scanned.
  • Card payments are a test-mode preview on shared PayBridgeNP test credentials. They show in your dashboard only and are refunded from the dashboard (not the refunds API).
  • Webhooks work normally in sandbox, but your URL must be publicly reachable. For local testing use ngrok or Cloudflare Tunnel.