MachariaK / Lipa-Na-Mpesa-Online-Firestore-Cloud-Function

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mpesa Callback Listener

A listener for MPesa post requests from Safaricom's gateway API.

The app uses CloudFunctions for Firebase to expose a publicly accessible endpoint, stores the transaction details in Cloud Firestore.

Refactored from: Mpesa Callback Listener.

Installation

git clone https://github.com/MachariaK/Lipa-Na-Mpesa-Online-Firestore-Cloud-Function.git

cd Lipa-Na-Mpesa-Online-Firestore-Cloud-Function

yarn install

cd functions 

npm install

Deploy to Firebase

Run firebase init functions, choosing not to overwrite existing files.

Deploy using
firebase deploy --only functions

Endpoints

/lmno_callback_url

Receives a callback for Lipa na MPesa transactions.
It stores the transaction details in Firestore under lmno_responses for both successful and failed transactions.

About


Languages

Language:JavaScript 100.0%