Logo Lanfrica

kn9ts/project-mulla

Domaine:

digital infrastructure

Type de record:

software
Créateur:
kn9
Hôte:
Talk to MPESA API via a REST API. Bringing the MPESA G2 API to the 21st century. -- > __What MPESA G2 API should have been in the 21st century.__ > __PLEASE NOTE: Mediates only C2B portion for now.__ Project Mulla is a MPESA API RESTful mediator . It lets you make familiar HTTP REST requests, transforming your requests to the fiddling dreaded SOAP/XML requests that the Safaricom MPESA G2 API only understands. It then communicates with the MPESA API gateway, transforming all SOAP responses from the SAG to RESTful JSON responses that you then consume effortlessly. In short, it’ll deal with all of the SOAP shenanigans while you REST. Everybody wins! The aim of **Project Mulla** is to create a REST API middleman that interfaces with the **MPESA G2 API** for you. # Important: Update 23-06-2017 When one now pings the endpoint `/payment/request` it initializes the payment and on response confirms the payment by also hitting the endpoint `payment/confirm` automatically This means you no longer have to make a second call to Project Mulla to confirm the payment thus hitting up the user's phone with the USSD prompt. One call to `payment/request` should handle this automatically. # Instructions ## Request Payment This initial step is to tell the SAG to initialise a payment transaction for you. After initialisation, you then make another request to the SAG as a confirmation signaling the SAG to process the payment request. Assuming __Project Mulla__ is now your mediator, you'd now make a __POST__ request to __Project Mulla__. _Not the Safaricom Access Gateway_. See below how you'd make this initial request: ### Initiate Payment Request: __`POST`__ __`project-mulla-companyname.h…`__ _Body Parameters_: - `phoneNumber` - The phone number of your client - `totalAmount` - The total amount you are charging the client - `referenceID` [optional] - The reference ID of the order or service - `merchantTransactionID` [optional] - This specific order's or service's transaction ID > __NOTE:__ If `merchantTransact …