Payment Gateway for WooCommerce Pakistan — JazzCash, Easypaisa and Raast Setup

Payment Gateway for WooCommerce Pakistan — JazzCash, Easypaisa and Raast Setup

WooCommerce has the plugin surface to make Pakistani payment acceptance a one-click install. Here is the shortest path from fresh WooCommerce install to taking live JazzCash, Easypaisa and Raast QR payments with ZurvaPay.

Two integration approaches

  1. Plugin-free redirect. Use WooCommerce's built-in "Direct bank transfer" or "Check payments" scaffold as the payment method shell, then redirect to ZurvaPay's hosted checkout. Cheap, no plugin maintenance.
  2. Lightweight custom plugin. A ~150 line PHP plugin that registers a WooCommerce gateway, initiates the ZurvaPay payment on checkout submit, and marks the order paid on IPN.

The clean (custom plugin) approach

Create a plugin folder zurvapay-for-woocommerce/, add a plugin file that extends WC_Payment_Gateway, implement process_payment($order_id) to call /api/v1/payments/initiate on the ZurvaPay API and return the redirect URL in the WooCommerce response:

return [
  'result'   => 'success',
  'redirect' => $zurvapay_redirect_url,
];

Register an IPN endpoint via woocommerce_api_zurvapay action that verifies the HMAC signature, matches the trx back to a WooCommerce order and calls $order->payment_complete().

Configuration a store owner has to touch

  • Enable the gateway under WooCommerce → Settings → Payments.
  • Paste API key and secret from the ZurvaPay dashboard.
  • Set the IPN URL in ZurvaPay to https://yourstore.pk/wc-api/zurvapay.
  • Toggle sandbox mode for testing, flip off for production.

Common pitfalls

  • Permalinks. Pretty permalinks must be on for /wc-api/ routing to work.
  • Session loss. If a customer's cart is wiped on return, confirm your session cookie's SameSite setting is Lax or None, not Strict.
  • Duplicate orders. Always idempotency-key on the ZurvaPay trx field — treat the IPN as authoritative, not the success-URL hit.

Why ZurvaPay is the practical choice

WooCommerce + a local gateway is still the cheapest way to launch a Pakistani online store that accepts wallets and Raast QR properly. ZurvaPay gives you a single integration that covers JazzCash wallet, Easypaisa wallet and Raast bank QR — the three rails that 90% of Pakistani customers actually use. You get:

  • Hosted checkout — a ready-made payment page so you do not have to build the payment form, maintain PCI-sensitive code or handle method logos yourself.
  • Instant payment notifications (IPN) delivered with HMAC signatures so your server reconciles automatically the moment money clears.
  • Sub-merchant accounts — run multiple websites, apps or brands under one onboarded ZurvaPay profile without a fresh application each time.
  • Agent program for anyone who wants to resell the platform to their own merchant book and earn a cut.
  • Self-onboarding — sign up and get test keys within minutes, no three-week banker meetings.

If you are comparing options for accepting online payments, start a free account at ZurvaPay, hit the sandbox for an hour, and judge by the integration experience itself.

Frequently asked questions

Is there a ready-made ZurvaPay WooCommerce plugin?

An official plugin is in testing. Until it ships, the ~150 line gateway class above is what most merchants use — and it is actually less code than the typical commercial Woo gateway plugin.

Can I run WooCommerce in test mode first?

Yes — toggle sandbox mode on the ZurvaPay gateway settings page. Sandbox payments return the full IPN flow without moving real money.

What about refunds?

A refund fired from WooCommerce can call the ZurvaPay refund API. Implement process_refund() in your gateway class and refunds work from the WooCommerce order screen.

#woocommerce pakistan#woocommerce jazzcash#woocommerce easypaisa#zurvapay woocommerce

Start accepting payments with ZurvaPay

Open a merchant account, connect your website with one API and get notified the moment a customer pays.