openpesa/laravel-pesa

Laravel应用简单集成OpenAPI

v1.0.2 2022-03-03 15:54 UTC

This package is auto-updated.

Last update: 2024-09-29 20:48:24 UTC


README

Latest Version on Packagist Total Downloads

提供与移动货币运营商(如Vodacom的M-Pesa)无缝集成的简便方法,以便轻松集成到您的Laravel应用程序中。💰

查看演示 · 报告错误 · 请求功能

文档

🚧 进行中

有关包使用详细说明,请参阅此处可用的示例readme:这里

🚀 安装

您可以通过Composer安装此包

composer require openpesa/laravel-pesa

💼 使用

使用外观

use Openpesa\Pesa\Facades\Pesa;

// This route will be mapped to: `your-URL/api/charge`
Route::get('/charge', function () {
    $response = Pesa::c2b([
        'input_Amount' => 5000, // Amount to be charged
        'input_Country' => 'TZN',
        'input_Currency' => 'TZS',
        'input_CustomerMSISDN' => '000000000001', // Replace with your phone number
        'input_ServiceProviderCode' => '000001', // Replace with your service provider code given by M-Pesa
        'input_ThirdPartyConversationID' => 'mpesatz', // Unique
        'input_TransactionReference' => 'imethibitishwa', // Unique
        'input_PurchasedItemsDesc' => 'Item description'
    });

    return $response;
});

💼 使用

composer test

📜 更新日志

请参阅CHANGELOG了解最近更改的详细信息。

🤝 贡献

请参阅CONTRIBUTING以获取详细信息。

🔐 安全漏洞

请参阅我们关于如何报告安全漏洞的安全策略

👥 致谢

📄 许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件