PayHere Payment Gateway Plugin for WooCommerce


PayHere is a Sri Lankan Payment Gateway Service that enables you to accept payments online from your customers via Visa, MasterCard, Amex, eZcash, mCash & Internet Banking services. You can install this plugin to list PayHere as a payment method in your WooCommerce store.

Lluniau Sgrin

  • PayHere configuration on WooCommerce admin area
  • PayHere subscription settings
  • PayHere Checkout page
  • PayHere Tokenized Customers list
  • PayHere Saved Cards Menu for Customers
  • Pay with saved card options
  • PayHere Hold on Card Capture


  1. Upload the plugin files to the /wp-content/plugins/plugin-name directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Use the WooCommerce->Settings->Checkout->PayHere screen to configure the plugin with your PayHere Merchant Account
  4. Make sure you tick the Sandbox Mode checkbox if you want to test the plugin with your PayHere Sandbox account

Cwestiynau Cyffredin

How to sign up for a PayHere Merchant Account?

Go to PayHere website & apply for a Merchant Account.

How to enable On-site checkout?

Go to WooCommerce Settings > Payments > PayHere > Manage and tick “Enable On-site checkout”

Does the plugin support WooCommerce Subscriptions?

Yes. Supported Subscription products can be checked out with the gateway.

What are the limitations in support for WooCommerce Subscriptions?

  1. Only one subscription can be checked out at one time
  2. An order cannot contain normal and subscription products
  3. Trial and billing periods must be equal
  4. The trial length cannot be larger than one billing period
  5. Synchronized subscriptions are not supported
  6. Free trials cannot be processed

How do customers use the Save Card Feature?

You should be a PayHere PREMIUM plan subscriber or using a PayHere Sandbox account to use this feature. After enabling the feature as explained in the “How do I use Use PayHere Tokenized Cards?”, customers will automatically see a “Save Card” tick mark when paying.

On their next visits, customers will be offered the option of paying with their saved card.

Can customers remove their Saved Card?

Yes. Customers should to navigate to My Account > Saved Cards. This menu will only appear for customers with saved cards.

Once in the menu, click “Remove Card”.

How do I integrate PayHere Tokenized Cards?

  1. You should be a PayHere PREMIUM plan subscriber or using a PayHere Sandbox account to use this feature
  2. Login to your PayHere Merchant Account
  3. Navigate to Settings > Business Apps > Create App
  4. Generate an App ID and App Secret
  5. Go to WooCommerce Settings > Payments > PayHere > Manage
  6. Click “Enable Tokenizer”
  7. Copy and paste the App ID and App Secret generated in Step 4
  8. Click Save

Can I view the list of customers with Pre-approved (saved) cards?

Yes. Navigate to WooCommerce > Cards on files

The plugin gets de-activated after updating to version 2.0.*

Go to WP-Admin > Plugins, and re-activated the PayHere plugin.


Ebrill 16, 2024
PayHere, led by Dhanika Aiya, offers a payment gateway solution that’s a boon for small businesses in Sri Lanka. Installation is a breeze, and checkout is smooth for customers. Plus, the fees are reasonable, making it accessible for all. Highly recommended!
Rhagfyr 16, 2019
Thanks, This is really useful for Sri Lankans.
Read all 6 reviews

Contributors & Developers

“PayHere Payment Gateway Plugin for WooCommerce” is open source software. The following people have contributed to this plugin.


Cofnod Newid


Initial public release


Fixed PayHere logo not showing issue


Fixed redirecting issue


Fixed Return URL issue in latest WP versions


Added support for On-site checkout


Fixed issue with On-site checkout in live mode


Fixed various issues


Fixed various issues


Bug fixes
WooCommerce Subscription Support


Bug fixes


Added support for Tokenized Payments


Added support for delete tokenized card payments


Added option to show/hide save card in frontend.


Fixed not Empty cart issue.


Fixed not auto redirecting issue on checkout page.


Fixed if woocommerce not active error plugin breaks and cannot login to the site.


Fixes bug caused by WordPress optimization, where Payment starts before PayHere.js is loaded.


Added better support for orders with many items.


Added in-code order blacklisting capabilities.


Small bug fix for Tokenize payments.


Remove Auto Trigger authorize payment if Card is already tokenized.


Hold on card support with small bug fixes.


Small bug fix for invalid amount format.


Small bug fix and add notice for hold on card support.


Small bug fix for authorization payment activated by default.


Fix a bug for some themes giving an error when editing a Post or a Page.


Added support for daily recurring payments.


Added input sanitizing for form fields to fix vulnerability issues.


Code standardize to PSR12 and WordPress


Code standardize to PSR12 and WordPress


Fix the issue with “Something went wrong” after the latest update (2.2.3)


Fix the issue with the Order complete message


Fix the issue with the Merchant ID not set in the backend and the frontend


Fix the issue with the redirect page not found.


Fix the issue with the redirect page not found and issue with plugin error when de-activate and activate.


Remove the line item name list from the “items” parameter and replace with the order id.


Fix the “order_key was called incorrectly” issue in thankyou page.


Fix the vulnerability with payhere logs.


Fix the vulnerability with payhere logs and disabled the loggin function.


Fix the issue with the Chackout page show deprecated warning/error.


Added support for WordPress blocks and resolved issues on the redirect page.


Fixed the issue occurring during plugin activation and update.


Fixed the issues occurring during plugin activation and update.


Enabled support for changing the gateway icon, resolved the issues with WordPress Blocks, and fixed the gateway viewing issue.


Fixed the issue with the text message when redirecting to the order-received page while the payment is pending.