aimtoget/aimtoget-agent-lib
Composer 安装命令:
composer require aimtoget/aimtoget-agent-lib
包简介
PHP Library for Aimtoget Agents
README 文档
README
PHP Wrapper for Aimtoget APIs
Installation
Using composer
composer install aimtoget/aimtoget-agent-lib
Add to your PHP code by including the autoload.php file
require_once "__DIR__/aimtoget-agent-lib/autoload.php";
Usage
- Configuration: You are required to initalize the configuration with your private key and wallet pin (Remember to always keep your private key Private!!!)
<?php use Aimtoget\Agent\Config; $config = new Config('--Secret key--', '--Wallet Pin--');
The configuration can now be utilized for other methods.
- To retrieve your wallet balance
<?php use Aimtoget\Agent\Account; $account = new Account($config); echo $account->getBalance();
- Airtime Purchase:
<?php use Aimtoget\Agent\Airtime; $airtime = new Airtime($config); //Purchase NGN100 Airtime $reference = $airtime->purchase([ 'phone' => '09061668519', 'network_id' => 1, 'amount' => 100 ]);
- Get all networks: This is required for airtime and data purchase
<?php use Aimtoget\Agent\Networks; $networks = new Networks($config); $all_networks = $networks->getAllNetworks();
- Get all data plans: Required for data purchase
<?php use Aimtoget\Agent\Data; $data = new Data($config); //All Plans $all = $data->getAllVariations(); //Retrieve plans for a certain network $plans = $data->getNetworkVariations($network_id);
- Purchase Data:
//Purchase 1GB of MTN data $reference = $data->purchase([ 'phone' => '09061668519', 'network_id' => 1, 'variation' => 'M1024' ]);
- Pay Bills & Services
<?php use Aimtoget\Agent\Services; $services = new Services($config); //Get all services $all = $services->getAll();
Retrieve Service Data & Variations
$service = $services->getService($service_id);
Verify service customer
$verify = $services->verifyCustomer($service_id, $customer_id);
Purchase service
$reference = $service->pay($service_id, [ 'customer_id' => $customer_id, 'amount' => $amount, //For services WITHOUT variations, 'variation' => $variaiton, //For services WITH variations, 'phone' => $customer_phone, 'email' => $customer_email ]);
Bank transfer
- Get all banks
<?php use Aimtoget\Agent\BankTransfer; $bank = new BankTransfer($config); //Get banks $banks = $bank->getBanks();
- Resolve Account Details
<?php use Aimtoget\Agent\BankTransfer; $bank = new BankTransfer($config); $account_name = $bank->resolveAccount('-bank code--', '-account number-'); echo $account_name;
- Make bank transfer
<?php use Aimtoget\Agent\BankTransfer; $bank = new BankTransfer($config); $reference = $bank->transfer([ 'amount' => 2000, 'bank_code' => '00007', 'account_number' => '0123456789', 'description' => 'Transfer narration' ]); echo $reference;
Transaction Details
- Retrieve your transactions:
Get a list of all your transactions using our APIs
<?php use Aimtoget\Agent\Transactions; $transactions = new Transactions($config); $list = $transactions->getTransactions(); //Fetches first 10 transactions
Get details for a single transaction
$details = $transactions->getTransaction($reference_code);
For any issue and complaint kindly contact us via developer@aimtoget.com
aimtoget/aimtoget-agent-lib 适用场景与选型建议
aimtoget/aimtoget-agent-lib 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 86 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 11 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 aimtoget/aimtoget-agent-lib 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aimtoget/aimtoget-agent-lib 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 86
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-11-20