Before you start
You need:- A WordPress site (5.8 or newer) running WooCommerce (7.0 or newer) on PHP 7.4 or newer
- Your store currency set to NPR (Nepalese Rupee) in WooCommerce → Settings → General
- A PayBridgeNP API key from the PayBridgeNP dashboard under Settings → API Keys (either
sk_live_…orsk_test_…) - Administrator access to your WordPress admin - the plugin upload requires
manage_optionscapability
Step 1 - Install the plugin
Pick whichever path suits your setup:Method A - From WordPress.org (recommended)
- In your WordPress admin, go to Plugins → Add New
- In the search box, type PayBridgeNP
- Find PayBridgeNP for WooCommerce and click Install Now
- Click Activate
Method B - ZIP upload
Use this if your host blocks WordPress.org’s plugin search, or if you need a specific version.- Download the latest release from paybridgenp.com/integrations/woocommerce by clicking the Download ZIP button. You’ll get a file named
paybridge-np-woocommerce.zip(about 2 MB; PHP SDK bundled, no Composer needed). - In your WordPress admin, go to Plugins → Add New → Upload Plugin
- Click Choose File and select the ZIP
- Click Install Now, then Activate Plugin
Method C - From source (developers)
Step 2 - Enable and configure the gateway
- Go to WooCommerce → Settings → Payments
- You’ll see PayBridgeNP in the list of available payment methods. Click Manage next to it
-
Fill in the settings:
- Click Save changes
Step 3 - Set up the webhook
The webhook is required. Without it, orders will be created but never move past On hold - they’ll sit there forever because WooCommerce is waiting for PayBridgeNP to confirm the payment server-to-server.- In your PayBridgeNP dashboard, go to Webhooks → Add endpoint
-
Set the URL to your store’s webhook endpoint:
Replace
yourstore.comwith your actual domain. The?wc-api=paybridge_webhookquery string is how WooCommerce routes the request to our gateway handler - it works regardless of your permalink structure. -
Events to subscribe to:
payment.succeededpayment.failedpayment.cancelled
- Click Create endpoint
-
PayBridgeNP shows you the signing secret (
whsec_…) exactly once. Copy it immediately. - Go back to WooCommerce → Settings → Payments → PayBridgeNP, paste the signing secret into the Webhook Signing Secret field, and click Save changes
Step 4 - Place a test order
Switch your WordPress admin to a non-admin browser (or use an incognito window) so you’re seeing the storefront as a customer would.- Add any product to your cart
- Proceed to checkout
- At the payment step, pick PayBridgeNP
- Click Place order
What should happen
- WooCommerce redirects you to the PayBridgeNP hosted checkout page
- You pick a wallet (eSewa, Khalti, or Fonepay) and complete the payment
- PayBridgeNP redirects you back to your store
- You land on the Order received page - the order shows as On hold
- Within a few seconds, the signed webhook arrives, and the order automatically moves to Processing (the normal WooCommerce state for a paid order awaiting fulfillment)
Sandbox test credentials
If you used ask_test_… key, use these built-in test credentials on the PayBridgeNP hosted checkout:
Sandbox payments appear in your PayBridgeNP dashboard under Sandbox - no real money moves.
Local development webhook testing
PayBridgeNP needs a publicly reachable URL to deliver webhooks. If your WordPress is running onhttp://localhost, you’ll need a tunnel tool to expose it:
https://xxx.ngrok.io/?wc-api=paybridge_webhook as your webhook endpoint URL in the PayBridgeNP dashboard. Switch it back to your real domain before going live.
Updating the plugin
If you installed via Method A (WordPress.org), updates are automatic. WordPress will show an update notice on Dashboard → Updates within ~24 hours of each release; click Update Now. If you installed via Method B (ZIP upload):- Download the latest ZIP from paybridgenp.com/integrations/woocommerce (or from the WP.org listing)
- In WordPress admin, go to Plugins → Add New → Upload Plugin
- Choose the new ZIP and click Install Now - WordPress will ask if you want to Replace current with uploaded. Say yes.
wp_options table, not in the plugin directory.
What’s next
- How it works - payment flow, order state transitions, webhook handling
- Troubleshooting - common install and runtime issues