gathuku/laravelmpesa
Composer 安装命令:
composer require gathuku/laravelmpesa
包简介
A simple mpesa package for laravel framework
README 文档
README
This package helps you integrate your laravel application with Mpesa daraja APIs. The package eliminates (almost)all the hassles and lets you concentrate on what is important.
The package will help you integrate with the following APIs, available on mpesa daraja;
- C2B (consumer to business)
- B2C (business to cunsumer)
- Lipa na mpesa online(Mpesa Express)
- Reversal
- Transaction status
- Account balance
Documentation
You are looking at it. But we've also got beautiful, fully navigable docs.
Installation
You can install this awesome package via composer
composer require gathuku/laravelmpesa
If you're using Laravel >=5.5, this is all you have to do.
Should you still be on version 5.4 of Laravel, the final steps for you are to add the service provider of the package and alias the package. To do this open your config/app.php file.
Add a new line to the providers array:
Gathuku\Mpesa\MpesaServiceProvider::class,
And optionally add a new line to the aliases array:
'Mpesa' => Gathuku\Mpesa\Facades\Mpesa::class,
Happy Coding 🎉 💯
Configuration
Next, after the package has been installed run;
php artisan mpesa:install
or
php artisan vendor:publish
This will help in publishing config/mpesa.php file.
This mpesa config file is where you will add all configurations for Mpesa APIs.
This includes the environment your application is running in(sandbox or production), callback URLs and required credentials.
You will obtain credentials from your app on Safaricom's developer portal.
<?php return [ //Specify the environment mpesa is running, sandbox or production 'mpesa_env' => 'sandbox', /*----------------------------------------- |The App consumer key |------------------------------------------ */ 'consumer_key' => 'aR7R09zePq0OSfOttvuQDrfdM4n37i0C', /*----------------------------------------- |The App consumer Secret |------------------------------------------ */ 'consumer_secret' => 'F9AebI6azDlRjLiR', /*----------------------------------------- |The paybill number |------------------------------------------ */ 'paybill' => 601380, /*----------------------------------------- |The Lipa Na Mpesa Online shortcode |------------------------------------------ */ 'lipa_na_mpesa' => '174379', ];
For production you need to replace with production credentials.
For security reasons you may want to define your API credentials in env file. For example;
'consumer_key' => env('CONSUMER_KEY'),
Usage
Full usage and examples in USAGE.md
Contributing
Thank you for considering contributing to laravelmpesa. Pull requests and issues welcome.
Be sure to read through CONTRIBUTING.md and check open issues and PRs before continuing.
Security Vulnerabilities
If you discover a security vulnerability within laravelmpesa, please send an e-mail to Moses Gathuku via hey@gathuku.me. All security vulnerabilities will be promptly addressed.
License
The laravelmpesa package is open-source software licensed under the MIT license
gathuku/laravelmpesa 适用场景与选型建议
gathuku/laravelmpesa 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19.43k 次下载、GitHub Stars 达 51, 最近一次更新时间为 2019 年 01 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「mpesa」 「gathuku」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gathuku/laravelmpesa 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gathuku/laravelmpesa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gathuku/laravelmpesa 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Beyonic PHP Library
Alfabank REST API integration
A simple mpesa package for laravel framework
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.
统计信息
- 总下载量: 19.43k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 51
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-19