forumpay / payment-gateway-php-client
支付网关PHP API客户端
v1.2.1
2024-07-11 08:27 UTC
Requires (Dev)
- phpunit/phpunit: ^9.6.0
- symplify/easy-coding-standard: ^9.3.10
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')
可用的端点
- Ping
- 获取汇率
- 启动支付
- 检查支付
- 获取交易
- 取消支付
- 获取货币列表
- 请求KYC
对应的方法请参阅src/PaymentGatewayApiInterface.php
中的PaymentGatewayApiInterface