algoetech/openapi_mpesa
最新稳定版本:0.01
Composer 安装命令:
composer require algoetech/openapi_mpesa
包简介
Easy OpenAPI integration for Laravel Applications
README 文档
README
Offers effortless integration with mobile money operators, such as Vodacom's M-Pesa, for seamless inclusion in your Laravel applications. 💰
Documentation
🚧 Work in Progress
For detailed instructions on package usage, please refer to the example readme available here.
🚀 Installation
You can install the package via Composer:
composer require algoetech/openapi_mpesa
💼 Usage
Using Facades
*Web|api Route
Route::post('/pay', [PaymentController::class, 'payment'])->name('payments_api');
*Controller [ PaymentController ]
use Openpesa\Pesa\Facades\Pesa; // This function will be mapped to web|api route: `your-URL/api/pay` // assuming you have data captured from a form public function payment(PaymentApiRequest $req) { $response = Pesa::c2b([ 'input_Amount' => $req->price, // Amount to be charged 'input_Country' => 'TZN', 'input_Currency' => 'TZS', 'input_CustomerMSISDN' => '255'.$req->msisdn, // assuming you capture phone number without country code and zero 'input_ServiceProviderCode' => '000001', // Replace with your service provider code given by M-Pesa 'input_ThirdPartyConversationID' => 'mpesatz', // Unique [use a rand function to isolate ConversationId] 'input_TransactionReference' => 'imethibitishwa', // Unique [] 'input_PurchasedItemsDesc' => $req->item ]); // make your logics to handle responses here return $response; };
💼 Usage
composer test
👥 Credits
📄 License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-24