mdmasudsikdar71/chapa-payment-gateway-laravel

Chapa支付网关的Laravel包

1.0.0 2024-02-27 22:38 UTC

This package is auto-updated.

Last update: 2024-09-28 00:20:13 UTC


README

Latest Version on Packagist Total Downloads

Chapa是一个提供与Chapa API交互客户端的Laravel包。此包简化了在您的Laravel应用程序中集成Chapa支付的过程。

功能

  • 交易初始化:通过简单的干净API轻松初始化Chapa交易。
  • 交易验证:验证Chapa交易以确保其有效性。
  • 定制:根据您的需求自定义和配置Chapa交易。
  • 清晰文档:代码库和API文档良好,易于集成和定制。

更多即将推出...

安装

您可以通过composer安装此包

composer require mdmasudsikdar71/chapa-payment-gateway-laravel

配置

安装包后,您需要发布配置文件

php artisan vendor:publish --tag="chapa-config"

然后,更新config/chapa.php配置文件,包含您的Chapa密钥。

使用

初始化Chapa交易

use MDMasudSikdar\Chapa\ChapaClient;

$chapaClient = new ChapaClient();

// Prepare the request body
$requestBody = [
    'amount' => 1000,
    'currency' => 'USD',
    'email' => 'user@example.com',
    // ... other required fields
];

// Initialize the transaction
$response = $chapaClient->transactionInitialize($requestBody);

// Handle the response
// $response contains the decoded response data

验证Chapa交易

use MDMasudSikdar\Chapa\ChapaClient;

$chapaClient = new ChapaClient();

// Transaction reference to verify
$txRef = 'your_transaction_reference';

// Verify the transaction
$response = $chapaClient->transactionVerify($txRef);

// Handle the response
// $response contains the decoded response data

安全

如果您发现任何安全相关的问题,请通过masudsikdar85@gmail.com.com发送电子邮件,而不是使用问题跟踪器。

许可

Chapa Laravel包是开源软件,许可协议为MIT许可