If you're a developer setting up payments for a Nepali product, you have two main approaches: integrate Khalti and eSewa directly, or use PayBridgeNP as a unified layer. This is an honest comparison - including the cases where direct integration is actually the better choice.
Direct Integration: How It Works
Both Khalti and eSewa provide REST APIs for merchant payment processing. The general flow:
- Apply for a merchant account with each provider
- Receive your merchant credentials (1-2 weeks per provider)
- Build a payment initiation endpoint for each
- Handle webhooks (or polling) for each
- Build a UI that shows both options
You end up maintaining two parallel integrations indefinitely.
Khalti direct integration (simplified):
import requests
# Initiate Khalti payment
response = requests.post(
"https://khalti.com/api/v2/epayment/initiate/",
headers={"Authorization": f"Key {KHALTI_SECRET_KEY}"},
json={
"return_url": "https://yoursite.com/payment/callback",
"website_url": "https://yoursite.com",
"amount": 1000, # paisa
"purchase_order_id": "ORD-001",
"purchase_order_name": "Product Name",
}
)
payment_url = response.json()["payment_url"]
eSewa direct integration:
// eSewa uses form-based POST with HMAC signature
$signature = base64_encode(hash_hmac(
'sha256',
"total_amount={$amount},transaction_uuid={$uuid},product_code={$productCode}",
$secret,
true
));
// Render a form that POSTs to eSewa's payment URL
Already you can see the APIs are completely different in structure, auth, and flow.
PayBridgeNP Integration
With PayBridgeNP, you integrate once and get both:
const session = await paybridge.checkout.create({
amount: 100000, // paisa
currency: "NPR",
customer: { name: "...", email: "..." },
successUrl: "...",
cancelUrl: "...",
});
// Redirect to session.checkoutUrl - customer picks Khalti or eSewa
One API. One webhook format. One dashboard.
Direct Integration: Pros
Lower per-transaction cost: No gateway fee on top of provider MDR. You only pay Khalti's or eSewa's fees directly.
Full control: You control the entire UX. You can build a custom payment UI that's deeply integrated into your app's design.
No dependency on a third party: If PayBridgeNP has downtime, your direct integration is unaffected.
Simpler for single-provider products: If your product only needs Khalti (common for some use cases), integrating only Khalti directly is perfectly valid.
Direct Integration: Cons
2x the work: Every piece of logic - initiation, webhook handling, refunds, testing, error handling - needs to be built twice.
Different APIs, different quirks: Khalti and eSewa have different authentication schemes, different response formats, different error codes, and different sandbox behaviors. You're doubling your integration surface area.
2x the maintenance: Provider APIs do change. Both Khalti and eSewa have updated their APIs in the past year. With direct integration, you track two providers' changelogs and update independently.
No unified reconciliation: You get Khalti transactions in one dashboard and eSewa in another. Cross-referencing your orders requires exporting and joining two datasets.
Approval time: Each provider has a separate merchant onboarding process. Getting approved for both can take 3-6 weeks total.
PayBridgeNP: Pros
One integration, all providers: Khalti, eSewa, and ConnectIPS from a single API.
Faster to market: No waiting for separate approvals. One onboarding process.
Single webhook format: All payment events arrive with identical structure regardless of provider.
Unified reconciliation: All transactions - Khalti, eSewa, ConnectIPS - in one dashboard.
Refund API: One refund endpoint that routes to the correct provider automatically.
Automatic SDK updates: When Khalti or eSewa update their APIs, PayBridgeNP handles it. Your integration doesn't change.
Non-provider features: Payment links, buttons, billing with reminders, MCP tools for AI agents - none of these are available from Khalti/eSewa directly.
PayBridgeNP: Cons
Gateway fee: PayBridgeNP charges a per-transaction fee on top of provider MDR. For high-volume merchants, this cost adds up.
Additional third-party dependency: If PayBridgeNP has issues, your checkout is affected. (Mitigated by PayBridgeNP's uptime SLA and status page.)
Less UI flexibility: PayBridgeNP's hosted checkout is highly customizable but ultimately a hosted page. Building a fully native payment UI requires using the API more extensively.
When to Use Direct Integration
- You only need one provider (just Khalti, or just eSewa)
- You're processing extremely high volume where 0.5% extra fee matters significantly
- You need a deeply custom payment UX that can't be achieved with a hosted checkout
- You have dedicated developer capacity to maintain multiple integrations
When to Use PayBridgeNP
- You need both Khalti and eSewa (covers most businesses)
- You want to launch faster and iterate
- You're a small team and don't want to maintain multiple provider integrations
- You use WooCommerce, Shopify, or WHMCS (plugins are available)
- You want payment links, buttons, or other features beyond basic checkout
- You want a unified dashboard for all transactions
The Bottom Line
For most Nepali businesses and developers, PayBridgeNP is the right default. The time saved (weeks of development + ongoing maintenance) easily outweighs the marginal gateway fee.
Direct integration makes sense for high-volume businesses or products that have a specific reason to need only one provider.
Try PayBridgeNP free - no monthly fees, no setup fees. See for yourself if it fits your needs before committing.