Payunit 线上聚合器 PHP SDK

1.0.10 2023-05-05 18:17 UTC

This package is not auto-updated.

Last update: 2024-09-21 01:34:50 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)"
    );
    

模式可以是 livetest

调用 MakePayment 方法。此方法将重定向到支付页面,客户可以在仪表板上激活的支付方式下进行支付

    $myPayment->makePayment("amount");

建议

出于安全原因,请确保您已阅读 Api 密钥、Api 密码和 Api 用户已设置在环境配置文件中

演示

演示应用程序链接 https://gitlab.com/sevencommonfactor/payunit-php-demo/-/tree/dev

许可证

Payunit PHP SDK 在私有许可证下发布 sevenCommonFactor