MPesa"

MPesa Daraja Safaricom

Setup

Read documentation https://developer.safaricom.co.ke/Documentation

On Mpesa MyApps page https://developer.safaricom.co.ke/MyApps click on “CREATE NEW APP”, use arbitrary name, select ALL products and click on “CREATE APP”. Screenshot 2024-10-15 at 17 17 09

Find the created app and click on copy icon to copy “Consumer Key” and “Consumer Secret”

Screenshot 2024-10-15 at 17 22 12

On Xceednet Location Settings click on tab “Payment Gateway” and click on “Edit”. Enable “Allow Renewal By Online Payment” and select “M-Pesa STK Push”. Paste “Consumer Key” and “Consumer Secret” and click “Save”

Screenshot 2024-10-15 at 17 26 20

If there is an error than check the credentials “Consumer Key” and “Consumer Secret”. Screenshot 2024-10-15 at 17 37 07

If there is no error on save than credentials are correct.

In order to receive webhooks we need to call API to “add c2b register url”. Click “Edit” and select “YES” under “Mpesa add c2b register url”

Screenshot 2024-10-15 at 17 39 15

In Sandbox mode you can “Mpesa add c2b register url” multiple times, but in production mode, you need to contact MPesa api support to clear old confirmation and validation URL and than select “Mpesa add c2b register url” and save, and contact MPesa api support to enable newly added URLs.

A short code is the unique number that is allocated to an organization through which they will be able to receive customer payment. It could be a Pay bill, Buy Goods or Till Number.

You can apply for a short code via https://m-pesaforbusiness.co.ke/apply

Passkey is sent to the developer account email address once the customer completes the Go Live process on Daraja.


Last modified October 16, 2024: Update index.md (1692827)