starnerz/laravel-daraja
Composer 安装命令:
composer require starnerz/laravel-daraja
包简介
A laravel package for the Safaricom Daraja APIs.
关键字:
README 文档
README
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.
Installation
Install via composer
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.
Add service provider to config/app.php in providers section
Starnerz\LaravelDaraja\LaravelDarajaServiceProvider::class,
Register Facade
Register package facade in config/app.php in aliases section
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.
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
Each Safaricom API except Oauth has been implemented as a class on its own which you can use in your code.
$STK = new STK(); $STK->push('254727123456','10000','New Purchase','R3F3R3NC3');
If you prefer using the facade
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.
# php artisan daraja:register-urls
Security
If you discover any security related issues, please email stanleykimathi@gmail.com instead of using the issue tracker.
starnerz/laravel-daraja 适用场景与选型建议
starnerz/laravel-daraja 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 777 次下载、GitHub Stars 达 7, 最近一次更新时间为 2018 年 03 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「mpesa」 「mpesa api」 「daraja」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 starnerz/laravel-daraja 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 starnerz/laravel-daraja 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 starnerz/laravel-daraja 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Beyonic PHP Library
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Mpesa driver for omnipay payment processing library
Laravel package for Accurate Online API integration.
Official Safaricom Daraja M-Pesa integration for Laravel built on ysg/payment-core.
统计信息
- 总下载量: 777
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-23