forumpay/payment-gateway-php-client

支付网关PHP API客户端

v1.2.1 2024-07-11 08:27 UTC

This package is auto-updated.

Last update: 2024-09-11 08:48:28 UTC


README

用于与支付网关Webhost API交互的PHP客户端

安装

运行composer require forumpay/payment-gateway-php-client

用法

获取货币列表的示例用法。

use ForumPay\PaymentGateway\PHPClient\PaymentGatewayApi;

$paymentGatewayApi = new PaymentGatewayApi(
    $paymentGatewayUri,
    $apiUser,
    $apiSecret,
    $userAgentApplicationIdentifier
);

try {
    $getCurrencyListResponse = $paymentGatewayApi->getCurrencyList('EUR');
} catch (ApiExceptionInterface $exception) {
    //TODO: handle the exception
}

其中

$paymentGatewayUri是API文档中的服务URL

$apiUser$apiSecret支付网关API密钥的凭据

$userAgentApplicationIdentifier代表HTTP客户端的用户代理应用程序标识符。示例:('MyPaymentApp/1.0.0')

Payment Gateway API Keys

可用的端点

  • Ping
  • 获取汇率
  • 启动支付
  • 检查支付
  • 获取交易
  • 取消支付
  • 获取货币列表
  • 请求KYC

对应的方法请参阅src/PaymentGatewayApiInterface.php中的PaymentGatewayApiInterface