sevengps / payunit
Payunit PHP SDK 用于在线聚合器
v1.0.8
2023-04-12 17:50 UTC
Requires
- php: ^7.2.5 || ^8.0
This package is not auto-updated.
Last update: 2024-09-24 01:25:53 UTC
README
这是由 sevenCommonFactor 为其 Payunit 聚合器平台开发的支付 SDK
要求
- PHP >= 7.2 (不兼容 PHP 7.3)
- 最新的 cURL 扩展
安装
composer require sevencommonfactor/payunit
使用方法
在您希望的控制器中添加 PayUnit 命名空间
use SevenGps\PayUnit
创建 PayUnit 类的新实例,并传递所有必需的属性
$myPayment = new PayUnit( "your_api_key", "your_api_password", "your_api_username", "returnUrl", "notifyUrl", "mode", "description", "purchaseRef", "currency", "merchant_name", "transaction_id (This id should be alpha numeric and less than 20 characters)" );
模式可以是 live
或 test
调用 MakePayment 方法。该方法将重定向到支付页面,客户可以在仪表板中激活的支付方式下进行支付
$myPayment->makePayment("amount");
建议
出于安全原因,请确保您已将 API 密钥、API 密码和 API 用户设置在环境配置文件中
演示
演示应用程序链接 https://gitlab.com/sevencommonfactor/payunit-php-demo/-/tree/dev
许可证
Payunit PHP SDK 在专有许可证下发布 sevenCommonFactor。