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.

steve-ongera/E-Commerce-M-Pesa-Paybill-Integration

Domaine:

digital infrastructure

Type de record:

software
Créateur:
ste
Hôte:
mpesa paybill integrations to an ecommerce shop/ store # E-Commerce M-Pesa Paybill Integration ## Requirements (requirements.txt) ```txt Django>=4.2 python-decouple>=3.8 requests>=2.31.0 Pillow>=10.0.0 ``` ## Installation & Setup ### 1. Install Dependencies ```bash pip install -r requirements.txt ``` ### 2. Create `.env` File Create a `.env` file in your project root with the following: ```env SECRET_KEY=your-secret-key-here DEBUG=True ALLOWED_HOSTS=localhost,127.0.0.1 MPESA_ENVIRONMENT=sandbox MPESA_CONSUMER_KEY=your_consumer_key MPESA_CONSUMER_SECRET=your_consumer_secret MPESA_SHORTCODE=174379 MPESA_PASSKEY=bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919 MPESA_CALLBACK_URL=your-ngrok-url.ngrok.io ``` ### 3. Create Logs Directory ```bash mkdir logs ``` ### 4. Run Migrations ```bash python manage.py makemigrations python manage.py migrate ``` ### 5. Create Superuser ```bash python manage.py createsuperuser ``` ### 6. Setup Ngrok (for local testing) M-Pesa callback requires a public HTTPS URL. Use ngrok: ```bash # Install ngrok from ngrok.com # Run your Django server python manage.py runserver # In another terminal, run ngrok ngrok http 8000 # Copy the HTTPS URL (e.g., abc123.ngrok.io) # Update .env file: MPESA_CALLBACK_URL=abc123.ngrok.io ``` ### 7. Get M-Pesa Credentials 1. Go to Safaricom Daraja Portal 2. Create an account 3. Create a new app 4. Get your **Consumer Key** and **Consumer Secret** 5. Get your **Passkey** from the app settings 6. For sandbox testing, use: - Shortcode: `174379` - Test Phone: `254708374149` ### 8. Register Callback URLs In the Daraja Portal: 1. Go to your app settings 2. Register your callback URL 3. Format: `your-domain.com` ## Project Structure ``` your_project/ ├── store/ │ ├── models.py # Database models │ ├── views.py # Views with M-Pesa integration │ ├── urls.py # URL patterns │ ├── admin.py # Admin configur …

Visit

github.com

Languages

Lusengo

Similaires

steve-ongera/AfyaBoraHMISsteve-ongera/mpesa_testing_api_stksteve-ongera/climate_insurance_platformsteve-ongera/ccba_forecaststeve-ongera/NyotaZetusteve-ongera/mpesa_system_application

steve-ongera/AfyaBoraHMIS

A comprehensive, cloud-ready HMIS built for Level 5 hospitals and multi-branch pharmacy chains in Ke

steve-ongera/mpesa_testing_api_stk

A Django-based e-commerce application integrated with M-Pesa STK Push for mobile payments testing in

steve-ongera/climate_insurance_platform

Africa's pastoralists and smallholder farmers are on the frontline of the climate crisis — and they

steve-ongera/ccba_forecast

AI-powered demand forecasting platform for Coca-Cola Bottlers Africa beverage supply chain. Predicts

steve-ongera/NyotaZetu

Nyota Zetu (Swahili for "Our Stars") is a comprehensive, AI-powered bursary management system design

steve-ongera/mpesa_system_application

A comprehensive full-stack mobile money system built with Django REST Framework and React, featuring