Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.paybridgenp.com/llms.txt

Use this file to discover all available pages before exploring further.

Sandbox mode lets you simulate complete payment flows - checkout, provider redirect, callback, webhook - without a real merchant account and without charging anyone.

How sandbox works

When your project is in sandbox mode, 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

These credentials are used automatically - you don’t need to enter them anywhere.
ProviderFieldValue
eSewaMerchant CodeEPAYTEST
eSewaSecret Key8gBm/:&EnhH.1/q
KhaltiSecret Keytest_secret_key_f59e8b7d18b4499ca40f68195a846e9b
FonepayMerchant CodeUAT credentials from Fonepay
FonepaySecret KeyUAT credentials from Fonepay

Running a test payment

1

Make sure your project is in sandbox mode

In the dashboard, go to Settings → API Keys and confirm the environment shows Sandbox. Your key should start with sk_test_.
2

Create a test checkout session

const session = await paybridge.checkout.create({
  amount: 1000,  // NPR 10.00
  returnUrl: "https://yoursite.com/success",
});

// Open session.checkout_url in your browser
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
  • Token: 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: 9800000001 through 9800000005
  • MPIN: 1111
  • OTP: 987654
5

Pay with Fonepay (UAT)

On the checkout page, select Fonepay. A Dynamic QR code is displayed - it refreshes every 3 minutes until paid or the session expires.To complete a UAT payment, scan the QR with a bank app that supports Fonepay UAT (most Nepali bank apps have a UAT mode). The payment is confirmed in real time via WebSocket - no page refresh needed.
Fonepay UAT requires merchant UAT credentials configured in your project’s Providers settings. Contact Fonepay to obtain UAT credentials.
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.

Switching to live mode

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 and Khalti credentials
  4. Update your server to use the sk_live_ key
Live mode processes 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 payments do not appear in your eSewa or Khalti merchant dashboard - they’re simulated end-to-end within PayBridgeNP
  • Fonepay sandbox uses UAT credentials - contact Fonepay to get UAT merchant access. UAT payments appear in the Fonepay UAT merchant panel
  • Webhook delivery works normally in sandbox - your webhook URL must be publicly reachable. Use ngrok or Cloudflare Tunnel for local testing