PayBridgeNPPayBridgeNP
woocommercepayment-gatewaytutorialnepal

How to Add a Nepal Payment Gateway to WooCommerce

Step-by-step guide to accepting Khalti, eSewa, and Fonepay payments on your WooCommerce store using PayBridgeNP's free plugin.

April 8, 20263 min readPayBridgeNP Team
How to Add a Nepal Payment Gateway to WooCommerce

WooCommerce is one of the most widely used e-commerce platforms. But out of the box, it doesn't support Khalti, eSewa, or Fonepay, the Nepali payment methods your customers actually use.

PayBridgeNP's WooCommerce integration fixes this with a free plugin.

This guide shows you exactly how to set it up in under 10 minutes.

What You'll Need

  • A WordPress site with WooCommerce installed
  • A PayBridgeNP merchant account (free to create)
  • Your Khalti and/or eSewa merchant credentials

Step 1: Install the PayBridgeNP WooCommerce Plugin

The easiest way is from the WordPress plugin directory:

  1. Go to your WordPress admin panel
  2. Navigate to Plugins > Add New
  3. Search for "PayBridgeNP"
  4. Click Install Now, then Activate

Alternatively, download the plugin from paybridgenp.com/integrations/woocommerce and upload it manually via Plugins > Add New > Upload Plugin.

Step 2: Configure the Plugin

After activation:

  1. Go to WooCommerce > Settings > Payments
  2. You'll see PayBridgeNP in the list. Click Manage
  3. Toggle Enable PayBridgeNP to on
  4. Paste your secret key (from the Keys page in your PayBridgeNP dashboard) into the Secret Key field
  5. Paste your webhook signing secret (whsec_..., shown when you add the webhook endpoint in your dashboard) into the Webhook Signing Secret field. This one is required, without it the plugin can't verify payment updates
  6. Set your preferred title (shown at checkout, e.g., "Pay with Khalti / eSewa")
  7. Save changes

Step 3: Test with Sandbox Keys

Before going live, test the integration. There's no separate test-mode toggle; the plugin simply follows whichever key you give it:

  1. In the plugin settings, paste your sandbox secret key (starts with sk_test_) into the Secret Key field
  2. Place a test order on your store
  3. Complete the payment using the sandbox providers

PayBridgeNP's sandbox gives you instant feedback on each payment event. No waiting for real transactions.

Step 4: Go Live

Once testing looks good:

  1. Replace the sk_test_ key in the Secret Key field with your live key (sk_live_...)
  2. Place a real test order for NPR 10 to confirm everything works end-to-end

How It Works at Checkout

When a customer reaches your WooCommerce checkout and selects PayBridgeNP:

  1. They click Place Order
  2. They're redirected to a PayBridgeNP-hosted checkout page showing Khalti, eSewa, and Fonepay options
  3. They pick their provider and complete payment
  4. They're redirected back to your WooCommerce order confirmation page
  5. The order status updates to Processing automatically

Order Management

The plugin automatically:

  • Updates order status when payment is completed
  • Marks orders as Failed when a payment fails or the customer cancels
  • Leaves orders on hold if the customer never completes payment, so you can follow up or cancel them yourself
  • Stores the PayBridgeNP payment ID in the order metadata
  • Supports WooCommerce order notes for payment events

Refunds

Process refunds from the PayBridgeNP dashboard. The WooCommerce plugin records the payment on the order, but the actual refund workflow lives in PayBridgeNP so provider-specific steps, status, and buyer notifications stay in one place.

Troubleshooting

Orders not updating after payment: Check that your PayBridgeNP webhook URL is registered. In your PayBridgeNP dashboard, open the Webhooks section and add: https://yourstore.com/?wc-api=paybridge_webhook

Plugin not appearing at checkout: Make sure the gateway is enabled and a secret key is saved. Both the classic shortcode checkout and the block-based WooCommerce checkout have been supported since version 1.0.0, so the checkout type itself is rarely the culprit.

Sandbox payments completing but live payments failing: Double-check that you switched API keys from sandbox to live in the plugin settings.

Conclusion

The PayBridgeNP WooCommerce plugin is the fastest way to add Nepali payment options to your store. It's free to install and takes less than 10 minutes to set up. Create your PayBridgeNP account to get your API keys and get started.


Related Articles

Ready to accept payments in Nepal?

Connect eSewa, Khalti, and Fonepay with a single API. Free to start, with no fund-holding and no new bank accounts.