PuranPay for WooCommerce
Official WooCommerce plugin for PuranPay — bKash, Nagad, Rocket, and Upay via hosted checkout and signed webhooks.
by PuranPay · github.com/alamincodes/puranpay-woocommerce · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/alamincodes/puranpay-woocommerce/archive/refs/heads/main.zipOfficial WooCommerce gateway for PuranPay. Create a checkout from the order, send the customer to hosted pay (bKash, Nagad, Rocket, Upay), fulfill only after a signed payment.verified webhook.
Requires WordPress 6.4+, WooCommerce 8.0+, PHP 7.4+, store currency BDT. Same API as the Node SDK (puranpay). No backend changes.
Install from zip
- Zip this folder (the folder that contains
puranpay-woocommerce.phpat the top level). - WordPress → Plugins → Add New → Upload Plugin.
- Activate. WooCommerce → Settings → Payments → PuranPay.
Connect the shop
On the gateway settings screen the plugin prints the two values PuranPay needs:
| Paste into PuranPay dashboard | Example |
|---|---|
| Settings → shop domain | yourshop.com (no https://) |
| Settings → Webhook URL | https://yourshop.com/wp-json/puranpay/v1/webhook |
Then:
- Billing → active plan.
- Copy secret key (
sk_test_while integrating,sk_live_in production) and webhook secret. - Paste both into the WooCommerce gateway. Enable Test mode only with
sk_test_. - Pair the phone app so official SMS can match TrxIDs.
successUrl / failUrl are HTTPS thank-you and pay-again links on this domain. Local HTTP only works against a PuranPay API running in development.
What the plugin calls
POST /api/paymentswithx-api-key,x-shop-domain,Idempotency-Key: wc-order-{id}- Redirect to
checkoutUrl - Webhook: HMAC-SHA256 of the raw JSON body vs
x-puranpay-signature - Optional
GET /api/payments/:idon the thank-you page if the webhook is late
Fulfillment is skipped when livemode does not match Test mode, when amounts differ, or when the order is already paid (orderId is the idempotency key for retries).
File map
puranpay-woocommerce.php boot, HPOS, Blocks, REST
includes/class-puranpay-api.php
includes/class-puranpay-webhook.php
includes/class-wc-gateway-puranpay.php
includes/class-puranpay-blocks.php
assets/js/blocks.js
Backend, checkout app, and the npm package stay untouched.