Download the PHP package savannabits/daraja without Composer
On this page you can find all versions of the php package savannabits/daraja. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download savannabits/daraja
More information about savannabits/daraja
Files in savannabits/daraja
Package daraja
Short Description Safaricom Mpesa API (Safaricom Daraja) for PHP Laravel . Simple integration with safaricom's MPESA API dubbed { DARAJA } and allow you to make requests in the nice
License MIT
Homepage https://github.com/savannabits/daraja
Informations about the package daraja
Description
The savannabits/daraja package is a Laravel package that makes it easier to talk to the Safaricom MPESA integration RESTFul API dubbed Safaricom Daraja.
Motivation
So why Daraja and not other packages out there? I have looked at a number of packages that can accomplish the same, but the solution I was looking for was a package that can allow me do token generation and Callback registration on the fly from my code. That means I can store my credentials (Consumer Key and consumer secret) even in a database and retrieve them dynamically, using them to register my callbacks. With this solution, you can even have a multiple shortcode gateway (Many apps each using a different paybill can use this gateway to talk to safaricom and register dynamic confirmation urls according to their needs).
Installation
You can install the package via composer:
Usage
Usage is very simple. If you are using C2B apis, the first step is to register the urls. Most of the work has been done for you under the hood.
Callback URLs Registration
That's it. You can even put this code inside a Console Command class so that you run something like php artisna mpesa:register-callbacks
from your terminal.
C2B simulation
If you are on Dev and would like to simulate a C2B transaction (without using any actual money) you can use the sandbox credentials and assuming you have registered the callbacks above, run the following:
STK Simulation (Lipa na MPESA Online)
Here is the method documentation
Validation and Confirmation Callback example, Finishing a Transaction
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Sam Maosa
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.