项目作者: GeeksTalk

项目描述 :
A laravel API implementation of Daraja Mpesa Online
高级语言: PHP
项目地址: git://github.com/GeeksTalk/mpesa_stk_api_laravel.git
创建时间: 2020-01-15T18:57:50Z
项目社区:https://github.com/GeeksTalk/mpesa_stk_api_laravel

开源协议:

下载


About This Project

This is a simple Mpesa Lipa Online STK push API implementation
Blog on @manuelgeek/mpesa-stk-api-implementation-laravel-wC5fF1GCq9UA2Z30E3Ii">GeekTalkThursday

Configuring

Git clone and Run Composer

  1. composer install

Create .env file

  1. cp .env.example .env

Generate Key

  1. php artisan key:generate

Set Up .env variables

For the staging environment, you can use the already gibe sandbox Short Code and Passkey, you’ll only need to generate the Consumer Key and Secret from the Daraja sandbox
For Production , you’ll have to provide the Short Code and Pass Key

  1. MPESA_SHORT_CODE=
  2. MPESA_PASSKEY=
  3. CONSUMER_KEY=
  4. CONSUMER_SECRET=

Running

  1. php artisan serve

For the API callback to be hit from Mpesa , you must use a live server , or use Ngrok in order to expose your local server (localhost)

Remember to replace the env APP_URL with the generated Ngrok URL

Licence

The Laravel framework is open-sourced software licensed under the MIT license.