Welcome to the M-Pesa Integration with PHP repository, provided by Burst Digital. This repo provides clean, production-ready code for integrating Lipa na M-Pesa Online into any website or application.
✅ Works with PHP | React | Python | POS Systems | CMS platforms (WordPress, Joomla, Odoo)
- Fast and secure Lipa na M-Pesa Online integration
- Clean and reusable PHP codebase using Safaricom’s Daraja API
- Easy setup with only 3 main files:
index.php
,daraja.php
,mpesa_callback.php
- Ready for both sandbox and production
- Free and open source
-
Get Your M-Pesa API Credentials
- Consumer Key & Secret
- Passkey
- Shortcode (Paybill or BuyGoods)
-
Configure Your Integration
- Edit
config.php
with your credentials - Set your callback URL to
https://yourdomain.com/mpesa/mpesa_callback.php
- Edit
-
Initiate a Payment
- Go to
index.php
, enter your phone and amount - Click “Pay Now” – the user gets an STK Push immediately on their phone
- Go to
-
Handle the Callback
mpesa_callback.php
listens for transaction updates and can be extended to log/verify/store results in your system
-
Test in Sandbox or Go Live
- Replace sandbox credentials with your live ones when ready
At Burst Digital, we don’t just stop at PHP—we integrate M-Pesa with:
- PHP, Laravel, Node.js
- React & React Native
- Python & Django/Flask
- Point of Sale (POS) Systems
- WordPress, Joomla, Odoo & other CMSs
💼 Need custom integration? Talk to us today.
👉 Read our step-by-step guide:
How to Integrate M-Pesa with PHP using Safaricom Daraja API (Part 2)
Need help with M-Pesa, web development, or anything digital?
- Email: [email protected]
- Phone: 0768871177
- Website: burstdigital.co.ke
Let’s power your platform with secure mobile payments. 💳📱
Thank you for choosing Burst Digital!