kevujin/comgate-client
Composer 安装命令:
composer require kevujin/comgate-client
包简介
Comgate client wrapper conatining all available developed request/responses
README 文档
README
Comgate API client
Comgate API client wrapper conatining all available developed request/responses
Is forked from from tomasz-kusy/comgate-client and contains also updates from renat-magadiev/comgate-client which is the original developer
Requirements
- PHP 7.4 or higher
- guzzlehttp/guzzle
Installation
$ composer require kevujin/comgate-client
Base usage - create a client
use Comgate\Client; $client = new Client( 'merchant', // your merchant ID you got from Comgate true, // if testing environment -> false = production 'secret' // secret passphrase/token you got from Comgate );
Create payment
use Comgate\Request\CreatePayment; $createPayment = new CreatePayment( 1000, // the price in cents 10.00 => 1000 'orderId', // your ID 'test@test.cz', // email of customer or some email for Comgate to communicate with if payment problems 'Product name' // payment label ); $createPaymentResponse = $client->send($createPayment); $redirectUrl = $createPaymentResponse->getRedirectUrl();
CreatePayment class has the same props as described in Comgate documentation
Get payment status
use Comgate\Request\PaymentStatus; $paymentStatus = new PaymentStatus( 'transId' // Comgate ID you received from create payment process ); $paymentStatusResponse = $client->send($paymentStatus);
PaymentStatus response class has the same props as described in Comgate documentation
Cancel payment
use Comgate\Request\CancelPayment; $cancelPayment = new CancelPayment( 'transId' // Comgate ID you received from create payment process ); $cancelPaymentResponse = $client->send($cancelPayment);
CancelPayment response and request class has the same props as described in Comgate documentation
Get payment methods
use Comgate\Request\GetMethods; $getMethods = new GetMethods( 'currency', // currency to filter methods for, could be null to match all available 'country' // country to filter methods available in, could be null to match all available ); $getMethodsResponse = $client->send($getMethods); var_dump($getMethodsResponse->methods); var_dump($getMethodsResponse->getMethod('BANK_ALL')); // exact one method
GetMethods response and request class are described in Comgate documentation
List transfers
Get the list of fund transfer for provided date. There might be more transfers in one day than only one or there can be none. Transfers are used to be processed about 15:00 GMT.
use Comgate\Request\ListTransfers; $listTransfers = new ListTransfers( date('Y-m-d') // let's look for today ); $listTransfersResponse = $client->send($listTransfers); var_dump($listTransfersResponse->transfers); // collection of Response\Item\Transfer
ListTransfers response and request class are described in Comgate documentation
For each transfer there is another API call to get its detail (exact payments) which are included in such transfer
foreach ($listTransfersResponse->transfers as $transfer) { // transfer is object Response\Item\Transfer $getTransferRequest = $transfer->createRequest(); // Request\GetTransfer $getTransferResponse = $client->send($getTransferRequest); var_dump($getTransferResponse->transferItems); // collection of Response\Item\TransferItem }
GetTransfer response and request class are described in Comgate documentation
kevujin/comgate-client 适用场景与选型建议
kevujin/comgate-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 10 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kevujin/comgate-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kevujin/comgate-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-29