Logo Lanfrica
  • Accueil
  • Atlas
  • Analyses
  • Documentation
  • Sign in

© 2026 Lanfrica. Tous droits réservés. Tous les droits d'auteur des ressources affichées sur le site Web Lanfrica appartiennent aux détenteurs de droits d'auteur d'origine, sauf indication contraire explicite.

eliezerke/flask-mpesa-stk

Domaine:

digital infrastructure

Type de record:

software
Créateur:
eli
Hôte:
Flask app for M-Pesa STK Push payments via Safaricom Daraja API - initiate, callback, status polling & dashboard. # Flask M-Pesa STK Push A lightweight Flask application that integrates **Safaricom Daraja API** for M-Pesa STK Push (Lipa Na M-Pesa Online) payments. It supports payment initiation, callback handling, real-time status polling, transaction storage in SQLite, and a simple dashboard with analytics. ## Features - Initiate M-Pesa STK Push requests - Handle Safaricom payment callbacks - Store transactions in SQLite with status tracking (`pending` / `success` / `failed`) - Real-time payment status polling endpoint - Clean checkout UI with form validation and loading states - Dashboard with payment history, status breakdown (pie chart), and successful volume by reference (bar chart) - Environment-based configuration via `.env` ## Project Structure ``` flask-mpesa-stk/ ├── app/ │ ├── __init__.py # Flask app & SQLAlchemy setup │ ├── config.py # App configuration │ ├── payload_stk.py # Access token + STK Push logic │ ├── routes.py # API & page routes │ └── templates/ │ ├── index.html # Main checkout page │ ├── donate.html # Donation-style UI (demo) │ └── dash.html # Transactions dashboard ├── models.py # Payment SQLAlchemy model ├── push.py # Entry point (creates tables + runs app) └── .gitignore ``` ## Prerequisites - Python 3.8+ - A Safaricom Developer Portal account - Consumer Key & Consumer Secret - Lipa Na M-Pesa Online Passkey - Business Shortcode (sandbox: `174379`) - A publicly reachable callback URL (use ngrok, Cloudflare Tunnel, etc. for local testing) ## Installation 1. **Clone the repository** ```bash git clone github.com cd flask-mpesa-stk ``` 2. **Create and activate a virtual environment** ```bash python -m venv venv source venv/bin/activate # Linux / macOS # or venv\Scripts\activate # Windows ``` 3. **Install dependencies** ```bash pip install flask flask-sqlalchemy python-d …

Visit

github.com

Languages

Lusengo

Similaires

rauell1/mpesa-stkitaueliud/mpesa-stkkisevu/Mpesa-STK-pushDenniskaninu/mpesa-push-stkfatumayussuf/mpesa-stk-pushGloriaAndonyaIT/flask-mpesa-cafe

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

Denniskaninu/mpesa-push-stk

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

fatumayussuf/mpesa-stk-push

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

GloriaAndonyaIT/flask-mpesa-cafe

Cafe ordering system with M-Pesa payment integration using Flask and Intasend API - Moringa AI Capst