We understand better that enim ad minim veniam, consectetur adipis cing elit, sed do

Contact Info

In the bustling world of e-commerce, providing customers with convenient and secure payment options is paramount. For businesses operating in Kenya, integrating the MPESA STK (Sim Toolkit) push feature into a WooCommerce WordPress website can be a game-changer. In this article, we are going to show you how to integrate WooCommerce Mpesa plugin in WordPress WooCommerce using a plugin.

However, there are many providers in the Kenyan market that help you achieve in receiving payments using M-PESA. Some of them include:

  • Paystack – Read how to integrate paystack payment gateway to your WooCommerce store here.
  • Intasend
  • Pesapal
  • DPO group
  • Flutterwave
  • JamboPay
  • Cellulant Corporation
  • iPay Africa
  • Kopo Kopo
  • Peach Payments

and many more.

Download Mpesa plugin for WordPress

Download the mpesa plugin for woocommerce from here to enable you to integrate to your WordPress website to start receiving online payments. This WordPress mpesa plugin supports:

  • Lipa na M-Pesa (both Paybill and Till number)
  • C2B offline payments using normal M-Pesa menu
  • Lipa na Bonga Points
  • Reversals

1. Setting Up the Daraja API 2.0 Sandbox

The first step in integrating M-PESA with your WordPress website is setting up the Daraja app. Safaricom’s Daraja API is what allows your website to communicate with the M-Pesa system. The sandbox is used for testing purposes. Steps on going live is discussed in chapter 2 below.

Step 1: Sign Up on Safaricom Developer Portal

Step 2: Creating your sandbox testing app

  • Once logged in, go to the “My Apps” section and create a new app.
  • You will need to provide a name for your app and select the API product you want to use (M-Pesa Express, C2B, B2C, etc.) and click on create app button.

Step 3: Get Your Credentials

  • After creating your app, you will be provided with a Consumer Key and Consumer Secret. These credentials will be used to authenticate your application.
  • Keep these credentials safe, as you’ll need them when configuring the plugin on your WordPress site.

2. Installing the WooCommerce Mpesa Plugin on WordPress

Once your Daraja app is set up, the next step is to install the WooCommerce Mpesa plugin on your WordPress website.

Step 1: Install the Plugin

  • Log in to your WordPress dashboard.
  • Navigate to Plugins > Add New.
  • Upload the plugin that you just downloaded earlier.
  • Click Install next to the plugin, then click Activate.

Step 2: Configure the Plugin

  • Once activated, go to WooCommerce > Settings.
  • Navigate to the Payments tab, and you’ll see M-Pesa as an option. Alternatively, you can hover on WooCommerce tab on the sidebar and select Configure M-Pesa link.

3. Configuring the WordPress Mpesa Plugin

With the plugin installed, you now need to configure it to connect with your Daraja app.

Step 1: Enter API Credentials

  • In the M-Pesa settings, enter the Consumer Key and Consumer Secret from your Daraja app.
  • Fill in other required fields, such as Short code (this is your business number or Till number) and Passkey (obtained from Safaricom).

Step 3: Customize Payment Instructions

  • You can customize the instructions that will appear to customers when they choose M-Pesa as their payment method.
  • Save all the settings once you’re done.

4. Testing the Integration

Before going live, it’s essential to test the M-Pesa integration to ensure everything works correctly.

Step 1: Enable Sandbox Mode

  • Go back to your plugin settings and enable Sandbox mode. This allows you to simulate transactions without using real money.

Step 2: Make a Test Transaction

  • Go to your website and add a product to the cart.
  • Proceed to checkout and select M-Pesa as the payment method.
  • Complete the transaction using the test credentials provided by Safaricom in Sandbox mode.

Step 3: Check Transaction Status

  • After completing the test transaction, check your Daraja app and website backend to ensure the payment was processed successfully.
  • If everything works as expected, disable Sandbox mode and switch to live mode.

3. Going LIVE

After testing everything using Sandbox. The next step is to go live so that you can start receiving real payments.

Step 1 :Business portal creation

Write an email to M-Pesa business team via this email (M-PESABusiness@safaricom.co.ke) and request them to create you a business administrator portal. Download this M-Pesa business Administrator application form and attach it when mailing the business team. If you have challenges on how to fill the document or how to write the email to M-PESA business team, feel free to call for guidance.

After M-PESA business team as created your portal, you will receive an email to the selected email of the administrator you have selected containing the username and the password to loin to the business portal below. You can access the portal via this link.

Reset your default password to activate your administrator portal account.

Now navigate to Daraja portal and click on Go live tab. Select Short Code as your verification type, enter your organization short code (either store number, Head office number or Paybill number). Enter your organization name and M-Pesa username. Please note that this username is the one that you requested the M-Pesa business team to use when creating your administrator portal credentials.

The selected administrator will receive the going live credentials, i.e. webhook links and passkey.

Now navigate to Daraja portal and switch from sandbox to the live app as shown below:

Now copy the Consumer key, Consumer Secret, Short code and paste them on the plugin as shown below. You will get the Online passkey from the email received after going live. If you don’t have it, write an email to M-Pesa API support team via apisupport@safaricom.co.ke to request for the same and activate your app:

Finally, test the final changes and push your app live, ready to receive online payments. If you might need any help in configuring the whole plugin, kindly let us know. You can WhatsApp, Call or email our support team via support@netech.co.ke for assistance.

Step 5: Test the STK Push

Your store can send stk push notifications to clients to allow them to pay with M-PESA once you have completed the above M-Pesa setup procedures.

2 Comments

  • Mark Jugg

    November 4, 2024

    Thank you for the informative post! It was an enjoyable read. I’d love to know more and stay in touch—any chance we could connect?

    Reply
    • admin

      December 23, 2024

      Thank you for your kind words and for taking the time to read my post! I’m thrilled you found it helpful and enjoyable. I’d be delighted to stay in touch and share more insights with you. Feel free to connect with me via WhatsApp for quick responses and fast communication. See you there.

      Reply

Leave A Comment