supermalang/paytech-client
Composer 安装命令:
composer require supermalang/paytech-client
包简介
A PHP Client or SDK for PayTech Online Payment Gateway. - Forked from papihack/paytech-php-client
README 文档
README
Forked from papihack/paytech-php-client
This is a simple SDK Client or API Client for PayTech Online Payment Gateway.
Check out PayTech SN Website.
How to use it
First of all, install the package or library via composer
composer require supermalang/paytech-client
After that, setup the API config with your parameters like this :
\PayTech\Config::setApiKey('your_api_key'); \PayTech\Config::setApiSecret('your_api_secret'); /* * you can set one of this two environment TEST or PROD * you can just set the env mode via \PayTech\Enums\Env::TEST or \PayTech\Enums\Env::PROD * Like the following example * !!! By default env is PROD !!! * You can also directly set test or prod as a string if you want * Like \PayTech\Config::setEnv('test') or \PayTech\Config::setEnv('prod') */ \PayTech\Config::setEnv(\PayTech\Enums\Env::PROD); /* * The PayTech\Enums\Currency class defined authorized currencies * You can change XOF (in the following example) by USD, CAD or another currency * All allowed currencies are in \PayTech\Enums\Currency class * !!! Notice that XOF is the default currency !!! */ \PayTech\Config::setCurrency(\PayTech\Enums\Currency::XOF); /* !!! Note that if you decide to set the ipn_url, it must be in https !!! */ \PayTech\Config::setIpnUrl('your_ipn_url'); \PayTech\Config::setSuccessUrl('your_success_url'); \PayTech\Config::setCanceUrl('your_cancel_url'); /* * if you want the mobile success or cancel page, you can set * the following parameter */ \PayTech\Config::setIsMobile(true);
Then you can proceed with :
$article_price = 15000; $article = new \PayTech\Invoice\InvoiceItem('article_name', $article_price, 'command_name', 'ref_command'); /* You can also add custom data or fields like this */ \PayTech\CustomField::set('your_field_name', 'your_field_value'); /* Make the payment request demand to the API */ \PayTech\PayTech::send($article); /* Get the API Response */ $response = [ 'success' => \PayTech\ApiResponse::getSuccess(), 'errors' => \PayTech\ApiResponse::getErrors(), 'token' => \PayTech\ApiResponse::getToken(), 'redirect_url' => \PayTech\ApiResponse::getRedirectUrl(), ];
After that, if you have a success response, you can redirect your user to the $response['redirect_url'] so that he can make the payment.
You can process the response as you wish by directly manipulating \PayTech\ApiResponse.
supermalang/paytech-client 适用场景与选型建议
supermalang/paytech-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 74 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 08 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Plateforme de paiement en ligne Afrique」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 supermalang/paytech-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 supermalang/paytech-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 supermalang/paytech-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PAYDUNYA PHP CLIENT
PHP package to communicate with the CMI payment plateform in Morocco
Error Handler for Ligne PHP
Application Monetico pour les paiements bancaires sur symfony
A PHP Client or SDK for PayTech Online Payment Gateway.
Generates form fields for payment and process payment notifications (IPN) for Systempay.
统计信息
- 总下载量: 74
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-29