Set up M-Pesa ​

M-Pesa is a mobile-money service in Kenya. With the M-Pesa integration, a cashier at the point of sale sends a payment request to the phone of the customer. M-Pesa works only at the point of sale, not in the webshop.

INFO

This gateway is provided by the payments app. Payment gateway settings moved out of ERPNext and the Frappe Framework into this app. Install it to see the settings page.

Prerequisites ​

  • An M-Pesa app approved for production (Go Live in the M-Pesa developer portal). Use the production URL and credentials that M-Pesa gives you.
  • A company whose currency is KES (Kenyan Shilling).

Enable M-Pesa ​

  1. Open Mpesa Settings.
  2. Enter all the mandatory values from M-Pesa.
  3. To test, select the sandbox option, and use the credentials of a separate test app.
  4. Save.

When you enable M-Pesa, ERPNext creates a Payment Gateway, a bank-type Account, and a Payment Gateway Account with the Phone payment channel. It also creates a Mode of Payment with the same name and account, and adds fields for M-Pesa to the POS.

Take an M-Pesa payment at the POS ​

  1. Add the M-Pesa mode of payment to the POS Profile.
  2. At checkout, select the M-Pesa mode of payment. ERPNext shows an additional information section.
  3. Enter the mobile number of the customer, and request the payment. The customer confirms the payment in the M-Pesa app.
  4. When the payment arrives, ERPNext asks you to submit the payment.

Check the M-Pesa account balance ​

In Mpesa Settings, select Get Account Balance. ERPNext shows the balance in the dashboard of the settings page.