Quick answer: to accept card payments on a WooCommerce store in Sri Lanka, apply for a PayHere merchant account, add your domain under Integrations in the PayHere portal to get a Merchant Secret, install the free PayHere Payment Gateway plugin, paste your Merchant ID and Merchant Secret into WooCommerce > Settings > Payments > PayHere, then test in sandbox mode before going live. Allow up to 24 hours for PayHere to approve your domain.
This guide walks through each step, explains which PayHere plan fits your store, and lists the problems we fix most often when Sri Lankan stores call us after a broken checkout.
What you need before you start
- A live WooCommerce store on your own domain, with an SSL certificate (your address starts with
https://). - An approved PayHere merchant account. You apply on payhere.lk with your business details and documents.
- Admin access to WordPress, and a recent backup of the site.
- Store currency set to LKR (or USD if your plan allows it). WooCommerce > Settings > General > Currency.
Which PayHere plan should a WooCommerce store choose?
PayHere’s published plans (checked November 2026 on the PayHere limits and fees page):
| Plan | Monthly fee | Processing fee | Limits | Good for |
|---|---|---|---|---|
| LITE | None | 3.3% | Up to Rs. 50,000 per payment, Rs. 200,000 per month. LKR and USD one-time payments only. | New stores testing demand |
| PLUS | Rs. 3,990 | 2.99% | Up to Rs. 250,000 per payment, Rs. 3,000,000 per month. Subscriptions, plus LKR, USD, EUR, GBP and AUD. | Most running stores |
| PREMIUM | Rs. 9,990 | 2.69% | Up to Rs. 1,000,000 per payment, no monthly limit. Automatic payments and saved cards. | High-volume stores and subscriptions |
Rule of thumb: PLUS pays for itself once you process more than roughly Rs. 1.3 million a month compared with LITE (0.31% of that is about Rs. 4,000). But hitting LITE’s Rs. 200,000 monthly cap usually forces the upgrade much earlier. When a customer goes over your limit, PayHere shows them an “Over Limit” error and the sale is lost, so upgrade before a big campaign, not after.
Step 1: Get your Merchant ID and Merchant Secret
- Sign in to your PayHere merchant account.
- Open Side Menu > Integrations. Your Merchant ID is shown here.
- Click Add Domain/App, enter your top-level domain (for example
yourstore.lk) and click Request to Allow. - Wait for approval. PayHere says this can take up to 24 hours.
- Copy the Merchant Secret shown next to your approved domain.
Important: the Merchant ID belongs to your account, but the Merchant Secret belongs to one domain. If you move the store to a new domain, or test on a staging domain, you need to add that domain and use its own secret. A secret from another domain is the most common reason payments fail with a hash or authorization error.
Step 2: Install the PayHere plugin
- In WordPress, go to Plugins > Add New.
- Search for PayHere Payment Gateway (published by PayHere, on WordPress.org).
- Click Install Now, then Activate.
Step 3: Configure PayHere in WooCommerce
- Go to WooCommerce > Settings > Payments and click PayHere (or Manage).
- Tick Enable PayHere.
- Set the title and description customers see at checkout, for example “Card, eZ Cash or Internet Banking (PayHere)”.
- Paste your Merchant ID and Merchant Secret.
- Tick Sandbox Mode for now (see Step 4).
- Optional: tick Enable On-site checkout so the payment window opens on your site instead of redirecting to PayHere.
- Click Save changes.
Step 4: Test with a PayHere sandbox account
The sandbox is a separate PayHere environment at sandbox.payhere.lk with its own login, Merchant ID and Merchant Secret. Create a sandbox account, add your domain there too, and put the sandbox credentials into WooCommerce while Sandbox Mode is ticked. PayHere publishes test card numbers in its support pages.
Check all three outcomes before going live:
- Successful payment: the order moves to Processing and stock reduces.
- Cancelled payment: the customer returns to the cart and the order stays Pending payment.
- Failed payment: the order is marked Failed, and no confirmation email goes out.
Then untick Sandbox Mode, switch to your live Merchant ID and Secret, and run one small real payment that you refund afterwards.
Common PayHere and WooCommerce problems (and fixes)
Payment succeeds but the order stays “Pending payment”
PayHere confirms payments by calling your site in the background (the notify URL). If that call is blocked, WooCommerce never hears that the customer paid. Usual causes: a security or firewall plugin blocking the request, a “coming soon” or maintenance mode plugin, HTTP basic auth on the site, or the store running on localhost. Whitelist the callback, or turn those blockers off and test again.
“Unauthorized payment request” or a hash mismatch error
The Merchant Secret doesn’t match the domain the request comes from. Typical cases are www versus non-www, a staging domain, or live credentials used with Sandbox Mode ticked (or the reverse).
Customers see “Over Limit”
You’ve hit your plan’s per-payment or monthly limit. Upgrade the plan in Settings in the PayHere portal. It takes effect without changing anything in WooCommerce.
PayHere doesn’t appear at checkout
Check that the store currency is one your plan supports. LITE accepts only LKR and USD. Also check that the gateway is enabled, and that a cart or checkout plugin isn’t hiding payment methods.
Checkout is slow or the page reloads twice
Caching plugins must not cache the cart, checkout or My Account pages. Exclude them in your cache settings (LiteSpeed Cache and WP Rocket exclude them by default, but custom page slugs can slip through).
PayHere, Onepay or a bank gateway?
PayHere is usually the fastest way for a small or new Sri Lankan store to take card and mobile wallet payments, because there’s no bank paperwork beyond PayHere’s own approval. Stores with high monthly volume often add a direct bank IPG (internet payment gateway) later for lower fees. Many run both: PayHere for wallets and convenience, the bank gateway for large card payments. If you sell abroad, check which currencies your plan supports before you advertise prices in USD, GBP or AUD.
Want it done for you?
We set up and test PayHere, Onepay and bank gateways on WooCommerce stores every week, including sandbox testing, order status checks and checkout speed fixes. If your checkout is losing orders, or you’re launching a new store, tell us about your store or message us on WhatsApp. See also our WooCommerce development service and fixed website prices.
FAQ
Is the PayHere WooCommerce plugin free?
Yes. The plugin is free on WordPress.org. You pay PayHere’s processing fee on each payment, plus a monthly fee on the PLUS and PREMIUM plans.
How long does PayHere domain approval take?
PayHere says domain approval can take up to 24 hours after you click “Request to Allow” under Integrations.
Can PayHere handle WooCommerce subscriptions?
Yes, on PLUS and PREMIUM, with limits. One subscription per order, no mixing with normal products, no free trials, and no synchronized renewals.
Can I accept USD with PayHere?
Yes. LITE supports LKR and USD one-time payments. PLUS and PREMIUM add EUR, GBP and AUD.
