How to accept MPESA Payments to your Woocommerce WordPress Website

How To Accept Mpesa Payments To Your Woocommerce Wordpress Website

Firstly, we have looked at how to integrate MPESA into a custom PHP website, and a Laravel website. Therefore,  let’s look at M-Pesa STK Push integration into a WordPress woo commerce website. In this article, we are going to show you how to integrate mpesa in WordPress woocommerce using a plugin.

Step 1: Set up App on Safaricom Daraja Portal

Before we set up woocommerce mpesa plugin on your ecommerce website, we have to set up the mpesa app on the Safaricom daraja platform. The next step is to create a new sandbox app by clicking on the Add a New App button and giving it a name. Ensure you select both Lipa na Mpesa Sandbox and Mpesa Sandbox and hit Create App button. Finally, copy the Consumer Key and Consumer Secret.

Safaricom Daraja Portal

In the next steps, let’s go to our woocommerce WordPress website. Woocomemerce is an open-source e-commerce plugin built on WordPress to make it an e-commerce store. Therefore, the first requirement would be to install the woocommerce plugin to your WordPress website. Go to your WordPress admin and follow these steps:

Step 2: Installing Woocommerce

  1. On the left darks section, go to Plugins then Add New.
  2. In the search bar, type “WooCommerce”.
  3. Click Install Now on the plugin by Automattic.
  4. Click Activate Now.

Installing Woocommerce In The Wordpress Admin

 

Step 3: Installing Woocommerce MPESA Payment plugin

With the woocommerce plugin installed, let us now add the WooCommerce MPESA Payment plugin. The mpesa WordPress plugin will enable us to easily add an option of paying for goods using M-PESA.  Download the mpesa plugin here. Install the WooCommerce MPESA payment gateway plugin by choosing the upload option.

To set up our mpesa payment gateway, go to Woocommerce > Configure MPESA

Step 4: Fill in your app and business details

Fill in the details below: Environment (Sandbox for testing and Live when active), Identifier type (Till number or paybill), Store number, business shortcode, App Consumer key, App Consumer Secret, Online Pass Key and Account reference.

Setting Up Woocommerce M-Pesa Payment Plugin

Step 5: Test the STK Push

Lastly, once you have filled in the mpesa setup details, your store is ready to send stk push to customers to make payments via mpesa.

The checkout should look something like the one below.

Testing Mpesa Stk Push In Woocommerce Wordpress Website

When the user enters the phone number, an STK Push is triggered on the phone to complete the order purchase.

Mpesa Stk Push On Phone

That’s how you set up stk push mpesa woocommerce. Thank you.

One Reply to “How to accept MPESA Payments to your Woocommerce WordPress Website”

  1. Avatar Of Binance binance says:

    I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

Leave a Reply

Your email address will not be published. Required fields are marked *