Read More
Read More
Menu Close

    Guide Magento 2 Mpesa Payment Gateway

    Magento 2 M-Pesa payment gateway is a secure mobile-based money transfer gateway that allows customers to pay using their mobile numbers securely in the store.

    Furthermore, This payment gateway gives customers the option of paying for their goods and items with the M-Pesa payment.

    Moreover, The admin can display the payment gateway logo on the checkout page, Also admin can allow selected countries to use the M-Pesa payment method.

    M-Pesa Payment Gateway Features

    • Magento 2 is compatible with the M-Pesa payment method.
    • Option to give the payment method a unique title.
    • The admin can make a full or partial refund online for any placed order.
    • The M-Pesa payment gateway logo can be display.
    • Allow M-Pesa payments in certain countries.
    • Payment using the mobile number
    • Customers are able to check their payment information in the “My Account” area.
    • Allow admins to check payment details in the backend’s Sales Order View.
    • Increases customer satisfaction and loyalty


    #Download Module

    Firstly, you need to log in to Webkul Store, go to My Account>My Purchased Products section, verify and then download and extract the contents of this zip folder on the system.

    #Upload Folder

    Once the module zip is extracted, follow path src>app and then copy the app folder into the Magento 2 root directory on the server as shown below:

    Start your headless eCommerce
    Read More
    Guide Magento 2 Mpesa Payment Gateway

    #3 Run Commands

    You need to run the following commands:

    • php bin/magento setup:upgrade
    • php bin/magento setup:di:compile
    • php bin/magento setup:static-content:deploy
    • php bin/magento indexer:reindex
    • php bin/magento cache:flush

    Language Translation of M-Pesa Payment Gateway

    For translating the module language, navigate through src/app/code/Webkul/Mpesa/i18n and edit the en_US.csv file. Thereafter, rename the CSV as “en_SA.csv” and translate all right side content after the comma in the Arabic language. After editing the CSV, save it.


    Then upload it to the path src/app/code/Webkul/Mpesa/i18n where the Magento 2 is installed on the server. The module gets translated into the Arabic Language. It supports both RTL and LTR languages.

    The user can edit the CSV like the image below.


    Admin Configuration

    So, after the module has been successfully install, the admin can setup it up from the admin panel by going to Stores->Configuration->Sales->Payment Methods->M-Pesa Payment.


    M-Pesa Payment Gateway Configuration Points:

    • Enable this Solution – The admin can enable this solution from here.
    • Sandbox Mode– By this option, the admin can enable or disable the Testing(sandbox) mode.
    • New order status- Here, the admin can select the status of the new order placed when we are selecting the respective payment method.
    • Title – Now, in this field, the admin has to enter the title for the M-Pesa payment Method, which will get displayed on the Front-end during checkout.
    • Upload logo from M-Pesa– Here, the admin can upload file extensions like PNG, JPG, JPEG for M-Pesa Logo.
    • CId- CId is given by M-Pesa after registration.
    • Payment from Applicable Countries – All those countries for which the admin wishes to make the payment method applicable.

    Magento 2 M-Pesa Payment Gateway Front End

    Now, After Successful Integration And the Setup Of The M-Pesa Payment Gateway For Magento 2.

    The Customer Can Visit The Website And Add The Product To The Cart, Then Process Further To Checkout And Complete The Order.


    Now, the customer can, however, view the payment method at the time of checkout and choose it for safer payment.

    The M-Pesa payment gateway will be redirected after clicking the “Place Order” button. To make a payment, the user will need to enter his or her mobile number and PIN. For more information, look at the image provided.

    ” If any error occurs during a transaction then the order will get created with order status “Pending Payment”. Otherwise status will show “Processing”.”


    Afterward, The Customer Will Redirect To The Thank You Page After Making The Successful Payment.


    Furthermore, once the order gets placed successfully, the customer will navigate to the My Orders sections to view the order details as per the below image:



    Also, the admin can easily view and manage the orders placed through the M-Pesa payment method. And, for this, the admin will navigate to Orders as per the below image.


    Here, the admin can view the complete list of orders.

    Moreover, can select the order to view and manage the orders. After clicking the View link, the order information page will open up as per the below image:



    That’s all for M-Pesa Payment Gateway for Magento 2 module.

    Still, have any issues feel free to add a ticket.

    Moreover, let us know your views to make the module better at our Webkul Support System.

    Current Product Version - 4.0.0

    Supported Framework Version - 2.0.x , 2.1.x , 2.2.x , 2.3.x , 2.4.x

    . . .
    Discuss on Helpdesk

    Leave a Comment

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

    Be the first to comment.

    Back to Top