2017 © Pedro Peláez
 

library laravel-daraja

A laravel package for the Safaricom Daraja APIs.

image

starnerz/laravel-daraja

A laravel package for the Safaricom Daraja APIs.

  • Friday, July 27, 2018
  • by starnerz
  • Repository
  • 3 Watchers
  • 2 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 114 % Grown

The README.md

Laravel Daraja

styleci Scrutinizer Code Quality Packagist Packagist Packagist, (*1)

This package provides you with a simple tool to make requests to Safaricom Daraja APIs so that you can focus on the development of your awesome applications instead of all the set up involved., (*2)

Installation

Install via composer, (*3)

composer require starnerz/laravel-daraja

Register Service Provider

Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature., (*4)

Add service provider to config/app.php in providers section, (*5)

Starnerz\LaravelDaraja\LaravelDarajaServiceProvider::class,

Register Facade

Register package facade in config/app.php in aliases section, (*6)

Starnerz\LaravelDaraja\Facades\MpesaApi::class,

Publish Configuration File

php artisan vendor:publish --provider="Starnerz\LaravelDaraja\LaravelDarajaServiceProvider" --tag="config"

Fill in all the details you will be requiring for your application. Here are the env variables for quick copy paste., (*7)

DARAJA_CONSUMER_KEY=
DARAJA_CONSUMER_SECRET=

DARAJA_INITIATOR_NAME=
DARAJA_INITIATOR_CREDENTIAL=
DARAJA_INITIATOR_SHORTCODE=

DARAJA_STK_SHORTCODE=
DARAJA_STK_PASS_KEY=

Usage

If you have not created your Safaricom API application yet you can create one at Safaricom Developer, (*8)

Each Safaricom API except Oauth has been implemented as a class on its own which you can use in your code., (*9)

``` php $STK = new STK(); $STK->push('254727123456','10000','New Purchase','R3F3R3NC3');, (*10)


If you prefer using the facade ``` php MpesaApi::STK()->push('254727123456','10000','New Purchase','R3F3R3NC3');

If you will be using the C2B Api you can easily register the validation and confirmation URLs through artisan., (*11)

``` bash, (*12)

php artisan daraja:register-urls

```, (*13)

Security

If you discover any security related issues, please email stanleykimathi@gmail.com instead of using the issue tracker., (*14)

The Versions

27/07 2018

dev-master

9999999-dev

A laravel package for the Safaricom Daraja APIs.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Stanley Mbaabu

laravel mpesa mpesa api daraja

27/07 2018

1.0.2

1.0.2.0

A laravel package for the Safaricom Daraja APIs.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Stanley Mbaabu

laravel mpesa mpesa api daraja

02/05 2018

v1.0.1

1.0.1.0

A laravel package for the Safaricom Daraja APIs.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Stanley Mbaabu

laravel mpesa mpesa api daraja

23/03 2018

v1.0.0

1.0.0.0

A laravel package for the Safaricom Daraja APIs.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Stanley Mbaabu

laravel mpesa mpesa api daraja