payson/paysonpayments

Payson 定期付款和 Payson Checkout API 客户端,适用于 PHP

2.1.2 2019-10-01 10:10 UTC

This package is not auto-updated.

Last update: 2024-09-26 09:00:41 UTC


README

Payson 定期付款和 Payson Checkout API 客户端,适用于 PHP

使用 Composer 进行设置

composer require payson/paysonpayments

使用 include 进行设置

require_once 'include.php';

创建连接器

// Include library (without composer)
require_once 'include.php';

// Connect to test environment
$agentId = '4';
$apiKey = '2acab30d-fe50-426f-90d7-8c60a7eb31d4';
$apiUrl = \Payson\Payments\Transport\Connector::TEST_BASE_URL;
 
$connector = \Payson\Payments\Transport\Connector::init($agentId, $apiKey, $apiUrl);

创建 Payson Checkout 客户端

$checkoutClient = new \Payson\Payments\CheckoutClient($connector);

创建定期订阅客户端

$recurringSubscriptionClient = new \Payson\Payments\RecurringSubscriptionClient($connector);

创建定期付款客户端

$recurringPaymentClient = new \Payson\Payments\RecurringPaymentClient($connector);

示例方法:getAccountInfo()

// getAccountInfo() can be used with all three clients
$accountInformation = $checkoutClient->getAccountInfo();

// Print the result
print('<pre>' . print_r($accountInformation, true) . '</pre>');

方法

Payson Checkout (\Payson\Payments\CheckoutClient)
  • getAccountInfo()
  • create()
  • get()
  • update()
  • listCheckouts()
Payson 定期订阅 (\Payson\Payments\RecurringSubscriptionClient)
  • getAccountInfo()
  • create()
  • get()
  • update()
  • listRecurringSubscriptions()
Payson 定期付款 (\Payson\Payments\RecurringPaymentClient)
  • getAccountInfo()
  • create()
  • get()
  • update()
  • listRecurringPayments()

示例

请参阅示例文件夹中的文件,以了解所有方法的示例。

文档

使用Payson Checkout REST APIPayson 定期付款 REST API获取有关可用参数的更多信息。

测试凭据

要立即访问我们的测试环境,只需创建一个Payson 测试账户以获取您自己的代理 ID 和 API 密钥。

要求

cURL PHP >= 7.0