FREE PesaPal Payment Module for Virtuemart 1.1.9 (J1.5)

PesaPal offers a wonderful payment gateway for developers to integrate with mobile payment solutions available in Kenya, namely M-Pesa and Airtel Money (at least as of the composition of this) and also with VISA! Now, unfortunately, they only offer basic integration instructions and no specific modules for major platforms like Joomla. I have therefore taken the liberty to develop a module for virtuemart that I hope you will find helpful. I have submitted it to the JED and I hope they will approve it. The Joomlasphere mentions many issues with approval of free VirtueMart extensions but I hope for the best.

Tested On:
- Virtuemart v1.1.9
- Joomla v1.5.26
- PHP v5.3.10 & MySQL v5.5.20



These scripts are offered freely and in good faith. Please do not pass this off as your own work or try to sell it without due credit. Check back with us at for updates/fixes. If you want more support/work done to it, you could consider a donation šŸ™‚


If you have any other PesaPal payment module(s) already installed on your Virtuemart setup, then make a copy, as a backup, of the following files (if they exist in your system):

  1. Download the from here.
  2. Unzip the filesĀ  to a temporary drive on your local computer
  3. Check that you don’t already have someone else’s pesapal payment module by looking in the folder as per my “Important Note” section above.
  4. Upload the OAuth.php, xmlhttprequest.php, ps_pesapal.php and ps_pesapal.cfg.php files to the directory (/administrator/components/com_virtuemart/classes/payment)
  5. Upload checkout.pesapal.php to the directory (/administrator/components/com_virtuemart/html)
  6. Login to your administration panel (back-end)
  7. Go to Components > Virtuemart > Store > List Payment Methods > New
  8. Ensure the “Active” checkbox is enabled (ticked)
  9. “Payment Method Name” should be PesaPal (doesn’t have to be but it’s easier to remember)
  10. “Code” is PESAPAL (again just easier to remember)
  11. Next to “Payment class name”, select ps_pesapal from the drop-down.
  12. For “Payment method type”, put a dot next to the HTML-form based (e.g. Paypal) option.
  13. Click on the “SAVE” icon (top-right).
  14. You should be returned to the “Payment Method List” page, click on the PesaPal entry you just made.
  15. Click on the Configuration tab (next to Payment Method Form tab)
  16. There should be a message saying that ps_pesapal.cfg.php is Writeable. If it isn’t then check the permissions on the file using your FTP client.
  17. Complete the fields just under this message as appropriate.
    • Merchant key should be the merchant key provided to you by pesapal. The module defaults to a test merchant key from the pesapal website
    • Secret key should be the secret key provided to you by pesapal. The module defaults to a test secret key from the pesapal website
    • Return URL should be the root of your website as the module and pesapal will add several parameters to it for checkout confirmation. This is editable to any other URL that you may desire to handle responses from pesapal
    • Cancel URL this can be left blank of the same as return URL. Functionality put in place for the day that pesapal adds a cancel link or button in their system
    • Order Statuses should be the statuses that Orders change to depending on repsonse from pesapal. Please note that these are editable from Virtumart Orders Menu
    • Confirmation Message is the message a user will get upon successful confirmation of a transaction from pesapal
    • Error Message is the message a user will get upon reportĀ  of an error in theĀ  transaction from pesapal
  18. Open the file payment_extra_info.txt (from the temporary folder where you extracted the modules files) and copy its content into the Payment Extra Info field of the form.
  19. Click on the “SAVE” icon again (top-right).
  20. Test as appropriate

Now that I’ve learnt to write Virtuemart Payment Modules, if there’s an e-merchant system that you would like to use that no one else has, I’ll be happy to look at a solution. Contact me or Leave a comment below. Also if you have any questions about this payment module, again do not hesitate to contact me.







  1. I am having a problem with pesapal checkout . I get this error.

    Problem: parameter_absent | Advice: > oauth_parameters_absent | PhoneNumber&Email

    what could i be doing wrong?

  2. PesaPal changed a few things in the way they work and I am working on an upgrade of the plugin. Should be out shortly. Please be patient.

  3. We are up to version 4 of PesaPal and its features have been a bit fluid, thus breaking my plugin. I am working on upgrade which I will annouce to all very VERY soon so juch check bank in like a week.

  4. Is pesapal reliable at all? can i intergrate it in joomla 2.5 and virtuemart 2.6? kindly let me know

  5. Yes – pesapal is quite reliable. You can check them out at – also, it is possible to integrate it with virtumart 2.0.6 and joomla 2.5 – but not with the current published module i have on the site. I am building one, just have not quite finished yet.

  6. Hi, just wanted to know how far you are with the virtumart 2.0.8a or other pesapal payment module

Leave a Reply