silahkosgei/mpesa
最新稳定版本:1.1.7
Composer 安装命令:
composer require silahkosgei/mpesa
包简介
Laravel M-PESA Integration Package
README 文档
README
A Laravel package for integrating with Safaricom's M-PESA STK Push and B2C APIs. Simple, extensible, and production-ready.
Installation
composer require SilahKosgei/mpesa:^1.1
Then publish the configuration file:
php artisan vendor:publish --tag=mpesa-config
Configuration
Add these to your .env file:
MPESA_ENV=sandbox # or production MPESA_SHORTCODE=601234 MPESA_BUY_GOODS_TILL=174379 MPESA_SHORTCODE_TYPE=PayBill # or BuyGoods MPESA_PASSKEY=YOUR_PASSKEY_HERE MPESA_CONSUMER_KEY=YOUR_CONSUMER_KEY MPESA_CONSUMER_SECRET=YOUR_CONSUMER_SECRET MPESA_CALLBACK_URL=https://yourapp.com/api/complete-payment MPESA_CONFIRMATION_URL=https://yourapp.com/api/confirmation-payment
Usage
Initiate STK Push
use SilahKosgei\Mpesa\Mpesa; $mpesa = new Mpesa(); $response = $mpesa->initiateStkPush( '254712345678', // phone 100, // amount 'ORDER-12345', // account reference 'Payment for Order #12345', // description 12345 // reference ID for callback );
Lookup STK Push Payment
$response = $mpesa->lookupPayment('ws_CO_123456789');
👤 Author
Silh Kosgei
📧 silakosy@gmail.com
🔗 GitHub: @silahkosgei
Version
v1.1.1
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-09