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.

Astraronix/mpesa

Domain:

digital infrastructure

Record type:

software
Creator:
Ast
Host:
# M-Pesa E-Ticketing System A complete serverless e-ticketing system with M-Pesa STK Push integration using Safaricom's Daraja API and Firebase Firestore. ## Features - M-Pesa STK Push payment integration - Real-time payment callback handling - Automatic ticket generation - Firebase Firestore database - Serverless architecture (Vercel) - Clean, responsive UI with vanilla JavaScript ## Project Structure ``` mpesa-eticketing/ ├── api/ │ ├── initiatePayment.js # Triggers M-Pesa STK Push │ └── callback.js # Handles M-Pesa payment callbacks ├── public/ │ ├── index.html # Frontend UI │ ├── script.js # Frontend JavaScript │ └── style.css # Styling ├── firebase.js # Firebase Admin SDK initialization ├── package.json # Dependencies ├── vercel.json # Vercel configuration └── .env.example # Environment variables template ``` ## Setup Instructions ### 1. Prerequisites - Node.js (v14 or higher) - Firebase project - Safaricom Daraja API account - Vercel account ### 2. Firebase Setup 1. Go to Firebase Console 2. Create a new project or use existing one 3. Go to Project Settings > Service Accounts 4. Click "Generate New Private Key" 5. Save the JSON file (you'll need this for environment variables) 6. Enable Firestore Database in your project ### 3. Daraja API Setup 1. Go to Daraja Portal 2. Create an account and log in 3. Create a new app to get credentials 4. For testing, use sandbox credentials 5. Note down your Consumer Key and Consumer Secret ### 4. Environment Variables 1. Copy `.env.example` to `.env`: ```bash cp .env.example .env ``` 2. Fill in the environment variables: - `FIREBASE_SERVICE_ACCOUNT`: Paste your entire Firebase service account JSON as a single line - `DARAJA_CONSUMER_KEY`: Your Daraja consumer key - `DARAJA_CONSUMER_SECRET`: Your Daraja consumer secret - `BUSINESS_SHORTCODE`: Your paybill/till number (use 174379 for sandbox) …

Visit

github.com

Languages

Lusengo

Similar

wasksofts/mpesaochom/mpesaPsycadelik/mpesatokelomakafane/mpesatishmalo/mpesamehulsbhatt/mpesa

wasksofts/mpesa

A PHP sdk for the new Mpesa RESTful APIs # Introduction Mpesa library which you can use with variou

ochom/mpesa

All M-Pesa APIs middleman # Mpesa Broker ## Overview ## Running the APP ## Configuration ### En

Psycadelik/mpesa

A demonstration of how to integrate Mpesa Express, C2B, B2C and B2B using the daraja API on safarico

tokelomakafane/mpesa

# M-Pesa OpenAPI Tester — Django App A local developer tool for testing the Vodacom M-Pesa OpenAPI

tishmalo/mpesa

Mpesa package in laravel # Laravel M-Pesa Package A Laravel package for integrating M-Pesa Lipa Na

mehulsbhatt/mpesa

MPESA - Website Integration using Yii