tinsoft/hot-recharge

v0.0.4 2024-01-30 21:50 UTC

This package is not auto-updated.

Last update: 2024-09-25 01:21:40 UTC


README

这是一个用于与HotRecharge API交互的PHP库,允许您执行各种操作,如充值、查询交易等。

入门指南

使用Composer安装库

composer require tinosoft/hot-recharge

通过创建HotRechargeAuth实例并使用它来初始化HotRecharge来配置身份验证。

根据需要使用库执行各种HotRecharge操作。

请随意探索库的功能,并根据您的特定用例进行适配。

有关更多详细信息和使用示例,请参阅代码和文档。

许可证 本项目采用MIT许可证 - 有关详细信息,请参阅LICENSE文件。

身份验证头

要使用此库,您需要使用HotRechargeAuth类设置身份验证详情。以下是配置方式:

require 'vendor/autoload.php';

use HotRecharge\HotRecharge;
use HotRecharge\HotRechargeAuth;

$authConfig = new HotRechargeAuth('your-access-email', 'your-access-password');
or 
$authConfig = new HotRechargeAuth('your-access-email', 'your-access-password', 'agent_reference');

$hotRecharge = new HotRecharge($authConfig);



## Usage Examples

## Recharging Pinless Example
$res = $hotRecharge->rechargePinless('amount', 'recipient_mobile_number');
echo $res;

recipient_mobile_number: The mobile number of the recipient.
amount: The recharge amount.

## Query Transaction Example
$res = $hotRecharge->queryTransaction('agent_reference');
echo $res;

agent_reference: The agent reference for the transaction you want to query.

## Recharging Zesa Example
$res = $hotRecharge->rechargeZesa('meter_number', recipient_mobile_number', 'amount');
echo $res;

meter_number : The meter number of the recipient.
recipient_mobile_number: The mobile number of the recipient.
amount: The recharge amount.