> ## 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.

# Provider Setup

> Add your merchant credentials to accept live payments through eSewa, Khalti, and Fonepay.

Before you can accept real payments, add your merchant credentials to your project in the [dashboard](https://dashboard.paybridgenp.com). PayBridgeNP uses these to initiate and verify payments on your behalf - money always lands directly in your own provider account.

<Note>
  You don't need credentials for sandbox testing. Built-in test credentials are used automatically. See [Sandbox Testing](/guides/sandbox-testing).
</Note>

## What buyers can pay with

Each provider gives buyers different ways to pay inside its own checkout. Through **Khalti**, buyers can pay from their Khalti wallet, mobile banking or e-banking of partner banks, or a card. Through **eSewa**, buyers pay from their eSewa wallet. Through **Fonepay**, buyers scan the QR from any Fonepay-network bank app, no separate account needed.

## eSewa

### Get your credentials

1. Log in to your eSewa merchant account at [merchant.esewa.com.np](https://merchant.esewa.com.np)
2. Go to **Profile → Merchant Code** - this is your `merchantCode`
3. Go to **Settings → Payment Integration** to find your `secretKey`

### Add to dashboard

1. Go to **Providers** in the dashboard
2. Click **Configure** next to eSewa
3. Enter your **Merchant Code** and **Secret Key**
4. Click **Save** and toggle the provider on

| Field          | Description                                       |
| -------------- | ------------------------------------------------- |
| `merchantCode` | Your eSewa product code                           |
| `secretKey`    | HMAC-SHA256 secret from the eSewa merchant portal |

***

## Khalti

### Get your credentials

1. Log in to [admin.khalti.com](https://admin.khalti.com)
2. Go to **API Keys**
3. Copy your **Secret Key** (starts with `live_secret_key_`)

<Warning>
  Use keys from [admin.khalti.com](https://admin.khalti.com) (live), not [test-admin.khalti.com](https://test-admin.khalti.com) (sandbox). Live keys start with `live_secret_key_`.
</Warning>

### Add to dashboard

1. Go to **Providers** in the dashboard
2. Click **Configure** next to Khalti
3. Enter your **Secret Key**
4. Click **Save** and toggle the provider on

***

## Fonepay

Fonepay uses Dynamic QR - customers scan a QR code with their Fonepay-connected banking app to pay. No redirect, no form; the payment is confirmed via WebSocket in real time.

### Get your credentials

Fonepay does not issue separate API keys. PayBridgeNP authenticates against the Fonepay merchant portal using the same credentials you use to sign in:

1. Have your Fonepay merchant account ready at [login.fonepay.com](https://login.fonepay.com)
2. Use the same **username** (phone number) and **password** you use to log in

<Note>
  PayBridgeNP encrypts these credentials with AES-256-GCM at rest and uses them only to log in to the Fonepay portal on each session. We never log or expose your raw password.
</Note>

### Add to dashboard

1. Go to **Providers** in the dashboard
2. Click **Configure** next to Fonepay
3. Enter your **Fonepay Username** (phone number) and **Fonepay Password**
4. Click **Save** and toggle the provider on

| Field      | Description                                                   |
| ---------- | ------------------------------------------------------------- |
| `username` | Your Fonepay merchant phone number (the one you sign in with) |
| `password` | Your Fonepay merchant portal password                         |

<Note>
  Fonepay refunds do not have an automated API. When a refund is issued, it is recorded as **Action required** - you must process it manually in the Fonepay merchant panel, then mark it as completed in the PayBridgeNP dashboard under **Refunds**.
</Note>

***

## Verifying your setup

After adding credentials:

1. Use your live API key (`sk_live_...`) in your server
2. Create a test checkout session for a small amount (NPR 1)
3. Complete the payment using your own account on that provider
4. Confirm the payment appears in your provider's merchant dashboard

If the payment succeeds end-to-end, your setup is correct.

***

## Security

Provider credentials are encrypted at rest using AES-256-GCM. PayBridgeNP never logs or exposes your raw credentials. You can update credentials at any time from the Providers page - changes take effect immediately.

***

## Tracking provider fees

Once your providers are configured, PayBridgeNP records the fee each provider charges on every successful payment, broken down per provider on your dashboard. eSewa requires you to set your negotiated rate; Khalti and Fonepay are automatic. See [Provider Fees](/guides/provider-fees) for the details.
