Skip to content

A PHP-based integration guide for M-Pesa payments, complete with code samples and a link to our comprehensive blog post on the topic.

License

Notifications You must be signed in to change notification settings

Burst-Digital-Kenya/mpesa-integration-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M-Pesa Integration with PHP – Safaricom Daraja API

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)


🚀 Features

  • 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

📦 How to Use

  1. Get Your M-Pesa API Credentials

    • Consumer Key & Secret
    • Passkey
    • Shortcode (Paybill or BuyGoods)
  2. Configure Your Integration

    • Edit config.php with your credentials
    • Set your callback URL to https://yourdomain.com/mpesa/mpesa_callback.php
  3. 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
  4. Handle the Callback

    • mpesa_callback.php listens for transaction updates and can be extended to log/verify/store results in your system
  5. Test in Sandbox or Go Live

    • Replace sandbox credentials with your live ones when ready

🔧 Services We Offer

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.


📖 Blog Guide

👉 Read our step-by-step guide:
How to Integrate M-Pesa with PHP using Safaricom Daraja API (Part 2)


📞 Contact

Need help with M-Pesa, web development, or anything digital?


Let’s power your platform with secure mobile payments. 💳📱
Thank you for choosing Burst Digital!

About

A PHP-based integration guide for M-Pesa payments, complete with code samples and a link to our comprehensive blog post on the topic.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages