Mpesa Integration

Hey team, need your input, I have plans to integrate Mpesa checkout on the Sambapos v5 payment screen(in kenya its called mpesa STK/Mpesa Epress). This how STK push works

  1. On a checkout, the mpesa API send a pop up on the customer phone, Requesting the customer to confirm the payment eg (payment of ksh 2000) transaction by entering their PIN

  2. The customer enters their pin and payment is completed

  3. The customer receives SMS message of the payment transaction
    4.The API sends a call back to a registered URL with a payload

  4. Processing of the response from the API and storage of the transaction in the DB

  5. If the customer does not have enough money in the Mpesa account, the the payment will fail and Mpesa will send the SMS to customer notifying them that they have less money in their account

I had implemented it for an app here so you can check it out

Now my concern is this: for the payment to be processed I need to send

1.Total amount to be paid
2.The Customer Phone number, Ticket number etc

Where do i get this two piece of information, Can i have a pop up immediately Mpesa payment is clicked requesting the Customers phone number? For the Total amount to be paid and Ticket number, How and where do I get them.

Lastly when the payment has been completed successfully, and I receive response from the API, how do sambapos know that the payment has been completed successfully

1 Like

The other method/old style seems to work well with other apps that use Mpesa.

1.Tell the client the total amount.
2.The client does the payment.
3.Client gives out the phone number once they receive the sms.
4. when the cashier presses mpesa payment button it also pops up an input box and asks
the client for the number, then it confirms with the details of the sms as per then.

Works well in supermarkets, but for restaurants it might be complex

Also safaricom were providing XMls as long as u were using SQL database Check with dem

Yaps, but what am looking for is for the payment process to be initiated from the vendors side, rather than the long process of going to the Sim and taking like 5 or 6 steps to complete the payment. I have implemented Mpesa STK and it seems simple.

Someone told me Naivas supermarket have implemented Mpesa in a smart way that they dont ask customers of any information, The payments are confirmed automatically

The only information will need from the customer is their phone number, all the rest is initiated from the vendors side, Check how I did this

I guess this method can be convenient for deliveries or retail points but when you look at a restaurant setups it might not be that worthy

Hello Stephen, did you manage to get the GraphQL calls needed to post payments to SambaPOS?

1 Like

Hi Sam… Look at this guide here. Integrator's GraphQL API Guide

That’s what I need it