Magento 2 MTN Pay Via MoMo

Magento 2 MTN Pay integrates Uganda's popular MTN payment gateway with Magento 2 using MoMo API to capture secure online payments.

 

Table of Content

  1. Extension Installation
  2. Configuration
  3. MTN Pay in Frontend
  4. MTN Pay in Backend

 

  1. Extension Installation
  • For Magento Marketplace Customers
    • Find the Composer name and version of the extension in the extension’s composer.json file.
    • Login to your SSH and run:
      • composer require meetanshi/magento-2-mtn-momo-pay --ignore-platform-reqs
    • Enter your authentication keys. Your public key is your username; your private key is your password.
    • Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.
    • To verify that the extension installed properly, run the command:
      • php bin/magento module:status Meetanshi_Mtn --ignore-platform-reqs
    • By default, the extension is probably disabled.
    • Enable the extension and clear static view files:
      • php bin/magento module:enable Meetanshi_Mtn --clear-static-content
      • php bin/magento setup:upgrade
      • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
      • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
      • php bin/magento cache:flush
  • For Meetanshi Customers
    • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
    • Login to your SSH and run below commands step by step:
      • php bin/magento setup:upgrade
      • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
      • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
      • php bin/magento cache:flush
  1. Configuration
    For configuring the extension, login to Magento 2, move to Sales > Payments Methods > MTN Pay MoMo where you can find various settings to enable the extension.
  • Enabled: Set “YES” to enable the payment method.
  • Title: Set the title for the payment method to be displayed in the frontend.
  • Show MTN Logo: Set YES to show MTN logo along with the payment method in the frontend.
  • API Provider Country: Select the country of the API provider.
  • Sandbox Mode: Select YES to enable sandbox mode.
  • API User Name: Enter the API user name provided by MoMo.
  • API Key: Enter the API key provided by MoMo.
  • Subscription Key: Enter the subscription key provided by MoMo.
  • URL for Request Payment: Enter the request payment URL for the transactions.
  • URL for Token: Enter URL for the token.
  • Payment from Applicable Countries: Select countries to allow using this payment method.
  • Instructions: Add instructions to show along with the payment method in the frontend.
  • Sort Order: Enter Sort Order of the payment method display in the frontend.

Note: Prior configuring the extension, you need to sign up for a FREE account to integrate MTN pay using the MoMo API. You can get more information on how to get API user name, API key and Subscription key here.


 

 

  1. MTN Pay in Frontend
    Once the payment method is configured, MTN payment method is shown on the frontend while checking out the products. Just enter MTN phone number and click to place order.


  

  • MTN Pay in “My Account” section
    Once the order is placed, the MTN payment method details are shown in the Account dashboard, in “My Orders” tab which includes method response code, response message, MSISDN and transaction ID.


  

  1. MTN Pay in Backend
    The Order View backend shows the payment information to admin. It displays the payment method name, response code, response message, MSISDN, and transaction ID.