Logo Lanfrica

Arthur-Muriuki/mpesa-prompt

Domain:

digital infrastructure

Record type:

software
Creator:
Art
Host:
This repository contains a Django-based web application that integrates with the M-Pesa API to initiate payment prompts via STK Push. # πŸ’Έ M-Pesa Prompt Integration This repository contains a Django-based web application that integrates with the **M-Pesa API** to initiate payment prompts via **STK Push**. --- ## πŸš€ Features - **πŸ“² STK Push Integration** – Sends payment prompts directly to users' mobile devices via M-Pesa. - **🧱 Django Framework** – Rapid backend development with a clean structure. - **πŸ—ƒ SQLite Database** – Lightweight local database for transactions. --- ## πŸ—‚οΈ Project Structure mpesa-prompt/ β”‚ β”œβ”€β”€ mpesademo/ # Django project configuration β”œβ”€β”€ myapp/ # Core logic for M-Pesa integration β”œβ”€β”€ db.sqlite3 # SQLite database β”œβ”€β”€ manage.py # Django management utility β”œβ”€β”€ .env # Environment variables (not tracked in Git) └── requirements.txt # Python dependencies --- ## βš™οΈ Technologies Used - **Python** – Backend language - **Django** – Web framework - **SQLite** – Development database --- ## πŸ§ͺ Getting Started ### βœ… Prerequisites - Python 3.x installed - Optional: Virtual environment tool --- ### πŸ”§ Installation 1. **Clone the Repository** ```bash git clone github.com cd mpesa-prompt ``` Create and Activate a Virtual Environment (Optional) macOS/Linux: bash Copy Edit python -m venv venv source venv/bin/activate Windows: bash Copy Edit python -m venv venv venv\Scripts\activate Install Dependencies bash Copy Edit pip install -r requirements.txt Configure Environment Variables Create a .env file in the root directory and add: env Copy Edit CONSUMER_KEY=your_consumer_key CONSUMER_SECRET=your_consumer_secret SHORTCODE=your_shortcode PASSKEY=your_passkey Apply Migrations bash Copy Edit python manage.py migrate Run the Server bash Copy Edit python manage.py runserver Open your browser at: πŸ‘‰ localhost πŸ’Ό Usage Navigate to the homepage. Enter payment details. Submit the form to initiate an STK Push request to the provided phone number. 🀝 Contributing Contributions are welcome! To contribute: Fork this repository. Create …

Languages