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

# WooCommerce

> Accept eSewa, Khalti, and Fonepay payments on your WordPress/WooCommerce store through PayBridgeNP.

PayBridgeNP for WooCommerce is an official WordPress plugin that adds a **PayBridgeNP** payment method to your WooCommerce checkout. Customers pick it like any other gateway, get redirected to PayBridgeNP's hosted checkout, pay with eSewa / Khalti / Fonepay, and land back on your order confirmation page - the order flips to Processing automatically via a signed webhook.

## Who this is for

* You run a **WooCommerce** store on self-hosted WordPress
* You want to accept **eSewa**, **Khalti**, or **Fonepay** from Nepali customers
* You already have (or can create) a [PayBridgeNP account](https://dashboard.paybridgenp.com/signup) with a `sk_live_…` or `sk_test_…` API key
* Your store's currency is **NPR**

## What you get

* **Classic checkout + Block checkout.** The plugin registers itself with both the legacy shortcode checkout and the modern WooCommerce Blocks checkout out of the box. Works whether your theme uses the old or the new checkout flow.
* **HPOS compatible.** The plugin declares compatibility with WooCommerce's High-Performance Order Storage, so it runs cleanly on modern WC installs using custom order tables.
* **Signed webhook verification.** Every incoming `payment.succeeded` / `payment.failed` / `payment.cancelled` event is verified against an HMAC-SHA256 signature before it moves any order - forged events are rejected with a 400 response.
* **Sandbox mode.** Use a `sk_test_…` key and every payment goes through the eSewa / Khalti sandbox environments - no real money moves while you test.
* **Permalink-agnostic.** Uses WooCommerce's `wc-api` endpoints, which work whether pretty-permalinks are enabled or not. No `.htaccess` surgery required.
* **GPL-2.0-or-later licensed.** Same license as WordPress and WooCommerce core.

## How it plugs in

```
┌────────────────┐  1. places order (picks PayBridgeNP)   ┌───────────────┐
│   Customer     │ ───────────────────────────────────────▶│  WooCommerce  │
└────────────────┘                                         └──────┬────────┘
                                                                  │ 2. process_payment()
                                                                  │    creates PayBridgeNP session
                                                                  ▼
                                                         ┌──────────────────┐
                                                         │  PayBridgeNP    │
                                                         │  hosted checkout │
                                                         └────────┬─────────┘
                                                                  │ 3. customer pays
                                                                  ▼
┌────────────────┐   5. thank-you page (order on-hold)    ┌──────────────────┐
│   Customer     │ ◀───────────────────────────────────── │  handle_return() │
└────────────────┘                                         └──────┬───────────┘
                                                                  │
                                                                  │ 4. signed webhook
                                                                  ▼
                                                         ┌──────────────────┐
                                                         │  handle_webhook()│
                                                         │  → processing    │
                                                         └──────────────────┘
```

**Two independent confirmation paths:** the customer's browser returns to your store immediately (marking the order **On hold**), and PayBridgeNP delivers a signed webhook server-to-server that marks the order **Processing** with the transaction id recorded. The webhook is authoritative - if the customer's browser never makes it back (closed tab, dead battery), the order still flips to Processing once the webhook arrives.

## What this plugin does NOT do

* **No in-store refund button.** Like the Shopify integration, refunds must be processed from the [PayBridgeNP dashboard](https://dashboard.paybridgenp.com) - not from WordPress admin. PayBridgeNP is a redirect gateway; the wallet provider owns the refund path, not WooCommerce.
* **NPR only.** Your store's currency must be set to NPR. Multi-currency support is on the roadmap.
* **No subscriptions / recurring billing** from within WooCommerce. One-off payments only. If you need recurring billing, use PayBridgeNP's [billing plans API](/api-reference/billing/plans/create-plan) directly from a custom integration.
* **Published on WordPress.org.** Install from the official [WordPress.org plugin directory](https://wordpress.org/plugins/paybridgenp-for-woocommerce/) or use the ZIP from [paybridgenp.com/integrations/woocommerce](https://paybridgenp.com/integrations/woocommerce) when you need a manual upload path.

## Next steps

* [Install the plugin](/integrations/woocommerce/install) - download the ZIP, upload it to WordPress, configure the gateway
* [How it works](/integrations/woocommerce/how-it-works) - the payment flow, webhook handling, and order state transitions explained
* [Troubleshooting](/integrations/woocommerce/troubleshooting) - common issues and how to fix them
