Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

papakowdadson/dadson-momo-stk

Domain:

digital infrastructure

Record type:

software
Creator:
pap
Host:
Software toolkit for momo payment in Ghana # dadson-momo-stk A simple Mobile money toolkit with reusable middleware and utilities for Express applications. ## Table of Contents - Installation - Usage - Middleware - createAccessToken - initializePayment - verifyPayment - Utilities - logger - Routes - License ## Installation To install this toolkit, you can use npm: ```sh npm install @papakowdadson/dadson-momo-stk ``` ## USAGE Here’s an example of how to use the toolkit in an Express application-MVC: - Create a .env file with the PORT value //Sample .env ```sh PORT=5000 MTN_BASE_URL_SANDBOX=sandbox.momodeveloper.mtn.c… // Textbed URL MTN_BASIC_AUTH=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX MTN_BASE_URL=proxy.momoapi.mtn.com // Production url MTN_OCP_COLLECTION_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` - Create index.js file ```sh //Sample index.js const express = require("express"); const cors = require("cors"); const app = express(); const { urlencoded } = require("express"); const dotenv = require("dotenv"); dotenv.config(); const port = process.env.PORT; const paymentRoute = require("./routes/paymentroute"); app.use(cors()); app.options("*", cors()); app.use(express.json()); app.use(urlencoded({ extended: true })); app.use("/@your url/payment", paymentRoute);//sample route, change to any route of your choice app.listen(port, () => { console.log(`server is running on ${port}`); }); ``` - Create Route file - Create Controller file ## Middleware createAccessToken Generates access token for each request from `MTN_BASIC_AUTH`. Call this method to generate access token before making any request.It accepts a callback function. Usage Example ```sh const mtnMomo = require('dadson-momo-stk'); const _Momo = mtnMomo(process.env.MTN_BASIC_AUTH,process.env.MTN_OCP_COLLECTION_KEY); const { createAccessToken } = _Momo; const GenerateAccessToken = (req, res, next) => { console.log("====creating access token===="); createAccessToken((error, body) => { if (body) { const _body = JSON.parse( …

Visit

github.com

Similar

rauell1/mpesa-stkitaueliud/mpesa-stkkisevu/Mpesa-STK-pushfatumayussuf/mpesa-stk-pusheliezerke/flask-mpesa-stkDenniskaninu/mpesa-push-stk

rauell1/mpesa-stk

TypeScript library for the M-Pesa STK Push lifecycle with built-in webhook relay server. # mpesa-st

itaueliud/mpesa-stk

# ⚡ TechSwiftTrix — M-Pesa STK Push A clean, fully functional M-Pesa STK Push payment application b

kisevu/Mpesa-STK-push

Sim Toolkit Push () STK Push (Sim Toolkit Push) It is a seamless way to initiate payments by promp

fatumayussuf/mpesa-stk-push

# Daraja-2.0-C2B-Intergration👨‍💻 made with 💖 BY Langat Fortune edit the credentials in stk_initiate.

eliezerke/flask-mpesa-stk

Flask app for M-Pesa STK Push payments via Safaricom Daraja API - initiate, callback, status polling

Denniskaninu/mpesa-push-stk

# 💳 M-Pesa Flask Integration A robust, production-ready Flask application for integrating M-Pesa ST