In order to implement Customer Online Shopping by M-Pesa, the eCommerce merchant needs to integration the merchant system to use the following M-Pesa API functions: C2B Payment, Reversal and Query.
Customer Online Shopping on PC with Hosted M-Pesa Payment page service flow
In order to complete payment by using customer’s M-Pesa funds, the merchant website can re-direct the customer to the Hosted M-Pesa Payment page to complete the M-Pesa payment. To confirm the payment, the M-Pesa customer will receive an USSD push message from M-Pesa and be asked to enter their M-Pesa PIN.
For more details, please see C2BPayment redirect to Hosted M-Pesa Payment page.
Reversal service flow
If customer wants to request a refund after a successful transaction, the customer will need to discuss and agree with the merchant. The merchant can call the Reversal API to refund the customer.
Query service flow
Merchant can query M-Pesa to check the status of the transaction by using the Query Txn API.