Payment Plugins

Woocommerce Mpesa Payment gateway - Wordpress

Just the other day, I had the privilege to integrate the Mpesa API on a wordpress ecommerce website running on woocommerce and I can tell you it is something you cannot avoid doing as a netpreneur in any country that accepts Mpesa mobile money. In this wordpress plugin, your customers will shop on your woocommerce shop, add goods or services to cart, proceed to checkout and choose Mpesa as their preferred Payment method. When entering their billing details, they will enter their mobile phone number and when they click proceed, an STK push will be sent to their phone number by the Mpesa system so that they only enter their Mpesa Pin and complete the transaction. As soon as they make the payment, the system will automatically receive the payment and autocomplete the purchase process. This is the power of the Mpesa API.

Before I even did this successfully for client, I had met the following questions from many clients and I will take a few minutes to clarify so you are the best informed when making a decision to add the Mpesa Payment gateway to your woocommerce shop.

Does WooCommerce support M-PESA?

We have developed an Mpesa plugin that work with any woocommerce shop. Therefore, YES, Woocommerce does support M-pesa. What specifically you need to know is that you have to engage a plugin developer to extend the core woocommerce plugin with the M-pesa plugin and we are here to help you.

How do I integrate M-PESA into my website?

To integrate M-pesa into your website, you need some knowledge in the programming language or CMS or framework or simply the technology used to develop it and use the Daraja API to integrate this API onto your website. You can do this yourself or hire a developer or download a ready-to use plugin that solves the M-pesa integration service on to your website.

Does WooCommerce work in Kenya?

A big YES. Woocommerce does work in Kenya in that you can easily install woocommerce onto your wordpress website and serve your online business within Kenya and also serve Kenyans. Woocommerce is therefore available in Kenya. You can download a copy of the official woocommerce website here.

Does M-PESA have an API?

Capital YES. M-pesa have an API which is found on Daraja. Find details about the Mpesa API on developer.safaricom.co.ke

M-pesa plugin for woocommerce per country.

Just as M-pesa serves many countries, we also have different Woocommerce M-pesa payment gateways for those different countries. This is because in each of those countries, M-pesa provides different APIs to integrate to. Find these in the table below:

Country Mpesa API Mpesa WC plugin
Kenya developer.safaricom.co.ke Mbiki WC mpesa Ke
Tanzania openapiportal.m-pesa.com Mbiki WC mpesa Tz

Integrate Mpesa C2B with your WooCommerce is very easy. With the assistance of our Woocommerce payment gateway plugin, you can simply install, do a small set up and activate and the rest is taken care of. You will be now very ready to receive Mpesa payments for your goods and services displayed on your woocommerce (WC) powered wordpress website.

Introduction.

Woocommerce runs on Wordpress and is said to be the future of of ecommerce. We therefore see it good to help you integrate your Woocommerce with Mpesa (For Kenyans). In this article, I will explain how it is easy to take advantage of PayMents now that we support Mpesa deposits and Payments if you are running a woocommerce website.

I have met people online who want a free version of this woocommerce Mpesa plugin. Let me say this: With the experience of working with Mpesa APIs for some years now and having seen the way the Mpesa API has been transforming over years from VPN ways, G1, G2 and now Daraja and may be we do not know what will happen tomorrow, a free version of a woocommerce Mpesa gateway plugin is not a sure bet. The best is a paid one with support from the developer so that you are assured of your ecommerce business future.

How to download this woocommerce Mpesa payment Gateway:

  1. Add to card the Mpesa woocommerce plugin below.
  2. The above step will take you to a checkout page of this nulled version of the plugin.
  3. Enter the details to register or login.
  4. Activate your account via a link sent to your email.
  5. Login and select Lipa na Mpesa as your Payment method.
  6. Click Finish to make payment.
  7. A popup will be send to your Mpesa phone you entered as your billing telephone with the details of your order, amount to pay.
  8. Enter the Mpesa PIN and Click OK.
  9. When the payment goes through. Refresh your "My orders" page and see your order automatically confirmed.
  10. Click the product name of the woocommerce mpesa plugin.
  11. Click the file name and it will automatically download the plugin.
  12. Save the resultant Zipped file in your desktop.
  13. That is all. You have the Mpesa woocommerce payment gateway plugin.

Requirements to Integrate your woocommerce website with Mpesa:

1. Mpesa PayBill number ==> This is applied at any Safaricom shop in Kenya. It takes 3 to 14 days to be ready. Visit the safaricom shop and you will get forms to fill.

You need a C2B Paybill to get paid by customers.

B2C on the other hand allows you to pay other personal Mpesa numbers/persons.

Be sure to apply what you need.

In this scenario, you will be getting paid for your goods and services on your woocommerce website.

Therefore, you need a C2B Mpesa Paybill.

2. After you have the Paybill number with you, contact MpesaBusiness via email (MPESABUSINESS@safaricom.co.ke) or phone (2222) and you will be given some requirements to send via their email so that they create an admin account which will allow you to access the Mpesa portal. This is the account which will enable you to create other operators on the Mpesa portal.

Recall the admin account on the Mpesa portal. We will need it.

Now, let us dive into the Integration of Woocommerce plugin with Mpesa.

Note: We have made the technical parts very easy for you. Your work is to copy and paste what we tell you to copy and paste where we tell you to.

Step 1: You need our Mpesa API integration assistant.

This is a ready PHP script which you will need to install in your server.

Below is the Mpesa API integration Assistant.

Note: In later releases, we have provided it inside Woocommerce plugin. So, no need to worry.

However, you need the steps below.

These steps are the ones which will guide you step by step, in an easy user-friendly way to have your PayBill set up.

The advantage of this Script is that, while it offers a quick and easy way to set up Mpesa C2B Paybill integration, it also comes with it more Payment gateways. In short, you are integrating your Woocommerce with multiple other Payment methods and you can activate and deactivate Payment methods on it as you so wish. It is all upon you and depends on the PayMents methods you need; Mpesa included.

Step 2: The above script will require that you provide some Mpesa C2B parameters. Login the admin of the script and locate the Mpesa C2B settings.

a). Register url (prefilled)

b). Confirmation url (prefilled)

c). Validation url (prefilled)

d). Paybill number (Fill this)

c). Mpesa Portal username (Fill this).

Save the above settings.

Step 3. Go To www.developers.safaricom.co.ke and create an account. Also, create a Sandbox/Test App and Move it to production by Click "GO live" and following the instructions there.

Step 4. When this production App is approved by Safaricom (Normally takes 2 to 3 business days), you will now have a Consumer Key and Consumer secret of the production Version of your App.

Step 5. Note the login to the Developer portal.

a). Go back to the PayMents processor and on the administration Block 2,==> C2B Mpesa settings, enter it as the Mpesa security token and save. ).

b). Consumer Key (Fill this as per your App on Safaricom Developer portal).

c). Consumer secret (Fill this as per your App on Safaricom Developer portal).

 

Step 6. Now, Click the "register urls" button  below the above settings.

A success message means everything is okay.

Everything is okay now.

Test with a transaction by sending some money to your Paybill.

You should see a transaction under the administration Block 3 --> Mpesa transactions.

You are done on Mpesa integration and now Mpesa is sending transactions to your Database.

Look at the PayMents balance, it is increasing when you make a Payment.

Step 7. Now, we need to have Mbiki Lipa na Mpesa for WooCommerce as one of the Payment options on your woocommerce website when people order and are paying.

Integrating Mpesa C2B with Woocommerce

for a live DEMO of Lipa na Mpesa payment using Paybill.

You need to download the Mbiki Lipa na Mpesa for WooCommerce plugin and install it like a Normal Wordpress plugin.

Activate it and set up some needed info found on Woocommerce ===> Settings ===> Payments/Checkout

You are done now.

Anytime someone selects the Lipa na Mpesa option, he or she will be directed to make payments via your Mpesa Paybill and the payments are automatically captured and order processed.

Mbiki Mpesa for WooCommerce