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.
Requirements
- React Native 0.73+ or Expo SDK 50+
react-native-webview>= 13react-native-safe-area-context>= 4
Compatible with Expo Go - no custom dev build or config plugin required.
Installation
How it works
Your backend creates a checkout session using your secret API key. The session is passed to the mobile SDK - your API key never touches the device.Backend: create a session
CallPOST /v1/mobile/session from your server:
| Field | Required | Description |
|---|---|---|
amount | Yes | In paisa (1 NPR = 100 paisa) |
provider | Yes | "esewa" or "khalti" |
customer.name | Yes | Customer’s full name |
customer.email | Yes | Customer’s email address |
customer.phone | Yes | Customer’s phone number |
description | No | Optional payment description |
metadata | No | Optional key-value metadata |
expires_at | - | Session expires in 15 minutes (response field) |
Usage
usePayBridgeNP hook (recommended)
Let the user pick the provider - session is created lazily after they tap.
Pre-built session
Use this when your backend picks the provider before showing the sheet.ProviderSheet directly
API reference
usePayBridgeNP(options)
| Option | Type | Required | Description |
|---|---|---|---|
session | MobileSession | null | No | Pre-built session from your backend |
createSession | (provider) => Promise<MobileSession> | No | Lazy factory - called when user picks a provider |
amount | number | No | Amount in paisa - shown before session is created (lazy mode) |
config | PayBridgeMobileConfig | No | Custom baseUrl, timeout |
onSuccess | (result: CheckoutResult) => void | Yes | Called on successful payment |
onFailure | (result: CheckoutResult) => void | Yes | Called on failed payment |
onCancel | () => void | Yes | Called when user cancels |
{ present, dismiss, isVisible, sheetProps }.
Pass either
session or createSession - not both. createSession is preferred as it defers session creation until the user has picked a provider.ProviderSheet props
Same options as usePayBridgeNP, plus visible: boolean.
PayBridgeMobileConfig
| Field | Default | Description |
|---|---|---|
baseUrl | https://api.paybridgenp.com | PayBridgeNP API base URL |
timeout | 30000 | Request timeout in ms |
CheckoutResult
MobileSession
Sandbox testing
Usesk_test_... keys on your backend. The sandbox uses real provider test environments - no extra setup needed.
eSewa sandbox test credentials
| Field | Value |
|---|---|
| eSewa ID | 9806800001 (or 02/03/04/05) |
| Password | Nepal@123 |
| Token | 123456 |
sk_test_... PayBridgeNP key.