v1.0.2 2024-09-24 14:06 UTC

This package is auto-updated.

Last update: 2024-09-24 14:24:46 UTC


README

Mundipagg API

如何构建

生成的代码依赖于外部库,如UniRest。这些依赖关系在SDK附带的composer.json文件中定义。为了解决这些依赖关系,我们使用Composer包管理器,它需要在您的系统中安装PHP版本大于5.3.2。访问https://getcomposer.org.cn/download/下载Composer安装程序文件并在您的系统中运行。打开命令提示符并输入composer --version。如果安装成功,这将显示已安装的Composer的当前版本。

  • 使用命令行,导航到包含生成的文件(包括composer.json)的SDK目录。
  • 运行composer install命令。这将安装所有必需的依赖关系并在您的项目目录中创建vendor目录。

Building SDK - Step 1

[仅限Windows用户] 在php.ini中配置CURL证书路径

CURL之前包含一组受信任的CA,但现在不再捆绑任何CA证书。因此,默认情况下,它将拒绝所有SSL证书,因为它们无法验证。您将需要获取您的CA的证书并将curl指向它。步骤如下

  1. https://curl.haxx.se/docs/caextract.html下载证书捆绑包(.pem文件)到您的系统中。
  2. 将curl.cainfo = "PATH_TO/cacert.pem"添加到您的php.ini文件中,该文件位于您的php安装中。“PATH_TO”必须是一个包含.pem文件的绝对路径。
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =

如何使用

以下部分解释了如何在新的项目中使用MundiAPI库。

1. 在IDE中打开项目

打开PHP的IDE,如PhpStorm。这里展示的基本工作流程也适用于您喜欢使用不同的编辑器或IDE的情况。

Open project in PHPStorm - Step 1

在PhpStorm中点击打开,浏览到您的生成的SDK目录,然后点击OK

Open project in PHPStorm - Step 2

2. 添加新的测试项目

如以下所示,在解决方案名称上右键单击以创建新的目录

Add a new project in PHPStorm - Step 1

将目录命名为"test"

Add a new project in PHPStorm - Step 2

向此项目添加PHP文件

Add a new project in PHPStorm - Step 3

将其命名为"testSDK"

Add a new project in PHPStorm - Step 4

根据您的项目设置,您可能需要在PHP代码中包含composer的自动加载器,以启用类的自动加载。

require_once "../vendor/autoload.php";

确保require_once路径正确指向在依赖关系安装期间创建的vendor目录中的autoload.php文件。

Add a new project in PHPStorm - Step 4

在此之后,您可以添加代码来初始化客户端库并获取控制器类的实例。后续部分提供了初始化客户端库和使用控制器方法的示例代码。

3. 运行测试项目

要运行您的项目,您必须为项目设置解释器。解释器是安装在您计算机上的PHP引擎。

文件菜单中打开设置

Run Test Project - Step 1

语言与框架中选择PHP

Run Test Project - Step 2

解释器选项附近浏览解释器并选择您的解释器。

Run Test Project - Step 3

选择解释器后,点击OK

Run Test Project - Step 4

要运行您的项目,在测试项目中的PHP文件上右键单击并点击运行

Run Test Project - Step 5

如何测试

可以使用PHPUnit运行此SDK中的单元测试。

  1. 首先使用composer安装依赖关系,包括require-dev依赖关系。
  2. 从命令行运行vendor\bin\phpunit --verbose以执行测试。如果您已全局安装PHPUnit,则使用phpunit --verbose运行测试。

您可以在phpunit.xml文件中更改PHPUnit测试配置。

初始化

身份验证

为了设置API客户端的身份验证和初始化,您需要以下信息。

API客户端可以按以下方式初始化。

$serviceRefererName = 'serviceRefererName';
$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MundiAPILib\MundiAPIClient($serviceRefererName, $basicAuthUserName, $basicAuthPassword);

类参考

控制器列表

Class: SubscriptionsController

获取单例实例

从API客户端可以访问SubscriptionsController类的单例实例。

$subscriptions = $client->getSubscriptions();

Method: createDiscount

创建折扣

function createDiscount(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsDiscountsRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->createDiscount($subscriptionId, $body, $idempotencyKey);

错误

Method: getSubscriptionItem

获取订阅项

function getSubscriptionItem(
        $subscriptionId,
        $itemId)

参数

示例用法

$subscriptionId = 'subscription_id';
$itemId = 'item_id';

$result = $subscriptions->getSubscriptionItem($subscriptionId, $itemId);

错误

Method: updateSubscriptionItem

更新订阅项

function updateSubscriptionItem(
        $subscriptionId,
        $itemId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$itemId = 'item_id';
$body = new SubscriptionsItemsRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionItem($subscriptionId, $itemId, $body, $idempotencyKey);

错误

Method: deleteUsage

删除使用

function deleteUsage(
        $subscriptionId,
        $itemId,
        $usageId,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$itemId = 'item_id';
$usageId = 'usage_id';
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->deleteUsage($subscriptionId, $itemId, $usageId, $idempotencyKey);

错误

Method: cancelSubscription

取消订阅

function cancelSubscription(
        $subscriptionId,
        $idempotencyKey = null,
        $body = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$idempotencyKey = 'idempotency-key';
$body = new SubscriptionsRequest();

$result = $subscriptions->cancelSubscription($subscriptionId, $idempotencyKey, $body);

错误

Method: getSubscription

获取订阅

function getSubscription($subscriptionId)

参数

示例用法

$subscriptionId = 'subscription_id';

$result = $subscriptions->getSubscription($subscriptionId);

错误

Method: deleteIncrement

删除增量

function deleteIncrement(
        $subscriptionId,
        $incrementId,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$incrementId = 'increment_id';
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->deleteIncrement($subscriptionId, $incrementId, $idempotencyKey);

错误

方法: getIncrementById

GetIncrementById

function getIncrementById(
        $subscriptionId,
        $incrementId)

参数

示例用法

$subscriptionId = 'subscription_id';
$incrementId = 'increment_id';

$result = $subscriptions->getIncrementById($subscriptionId, $incrementId);

错误

方法: getSubscriptionCycleById

GetSubscriptionCycleById

function getSubscriptionCycleById(
        $subscriptionId,
        $cycleId)

参数

示例用法

$subscriptionId = 'subscription_id';
$cycleId = 'cycleId';

$result = $subscriptions->getSubscriptionCycleById($subscriptionId, $cycleId);

错误

方法: updateSubscriptionStartAt

更新订阅的开始日期

function updateSubscriptionStartAt(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsStartAtRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionStartAt($subscriptionId, $body, $idempotencyKey);

错误

方法: updateSubscriptionPaymentMethod

更新订阅的支付方式

function updateSubscriptionPaymentMethod(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsPaymentMethodRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionPaymentMethod($subscriptionId, $body, $idempotencyKey);

错误

方法: updateCurrentCycleStatus

UpdateCurrentCycleStatus

function updateCurrentCycleStatus(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new UpdateCurrentCycleStatusRequest();
$idempotencyKey = 'idempotency-key';

$subscriptions->updateCurrentCycleStatus($subscriptionId, $body, $idempotencyKey);

错误

方法: createSubscription

创建新的订阅

function createSubscription(
        $body,
        $idempotencyKey = null)

参数

示例用法

$body = new SubscriptionsRequest1();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->createSubscription($body, $idempotencyKey);

错误

方法: getSubscriptions

获取所有订阅

function getSubscriptions(
        $page = null,
        $size = null,
        $code = null,
        $billingType = null,
        $customerId = null,
        $planId = null,
        $cardId = null,
        $status = null,
        $nextBillingSince = null,
        $nextBillingUntil = null,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$page = 83;
$size = 83;
$code = 'code';
$billingType = 'billing_type';
$customerId = 'customer_id';
$planId = 'plan_id';
$cardId = 'card_id';
$status = 'status';
$nextBillingSince = date("D M d, Y G:i");
$nextBillingUntil = date("D M d, Y G:i");
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");

$result = $subscriptions->getSubscriptions($page, $size, $code, $billingType, $customerId, $planId, $cardId, $status, $nextBillingSince, $nextBillingUntil, $createdSince, $createdUntil);

错误

方法: getUsagesDetails

GetUsagesDetails

function getUsagesDetails(
        $subscriptionId,
        $cycleId = null,
        $size = null,
        $page = null,
        $itemId = null,
        $group = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$cycleId = 'cycle_id';
$size = 83;
$page = 83;
$itemId = 'item_id';
$group = 'group';

$result = $subscriptions->getUsagesDetails($subscriptionId, $cycleId, $size, $page, $itemId, $group);

错误

方法: renewSubscription

RenewSubscription

function renewSubscription(
        $subscriptionId,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->renewSubscription($subscriptionId, $idempotencyKey);

错误

方法: getSubscriptionCycles

GetSubscriptionCycles

function getSubscriptionCycles(
        $subscriptionId,
        $page,
        $size)

参数

示例用法

$subscriptionId = 'subscription_id';
$page = 'page';
$size = 'size';

$result = $subscriptions->getSubscriptionCycles($subscriptionId, $page, $size);

错误

方法: createAnUsage

创建使用记录

function createAnUsage(
        $subscriptionId,
        $itemId,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$itemId = 'item_id';
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->createAnUsage($subscriptionId, $itemId, $idempotencyKey);

错误

方法: getUsages

列出订阅项的所有使用记录

function getUsages(
        $subscriptionId,
        $itemId,
        $page = null,
        $size = null,
        $code = null,
        $group = null,
        $usedSince = null,
        $usedUntil = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$itemId = 'item_id';
$page = 83;
$size = 83;
$code = 'code';
$group = 'group';
$usedSince = date("D M d, Y G:i");
$usedUntil = date("D M d, Y G:i");

$result = $subscriptions->getUsages($subscriptionId, $itemId, $page, $size, $code, $group, $usedSince, $usedUntil);

错误

方法: deleteDiscount

删除折扣

function deleteDiscount(
        $subscriptionId,
        $discountId,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$discountId = 'discount_id';
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->deleteDiscount($subscriptionId, $discountId, $idempotencyKey);

错误

方法: getIncrements

获取增量

function getIncrements(
        $subscriptionId,
        $page = null,
        $size = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$page = 83;
$size = 83;

$result = $subscriptions->getIncrements($subscriptionId, $page, $size);

错误

方法: createSubscriptionItem

创建新的订阅项

function createSubscriptionItem(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsItemsRequest1();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->createSubscriptionItem($subscriptionId, $body, $idempotencyKey);

错误

方法: getSubscriptionItems

获取订阅项

function getSubscriptionItems(
        $subscriptionId,
        $page = null,
        $size = null,
        $name = null,
        $code = null,
        $status = null,
        $description = null,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$page = 83;
$size = 83;
$name = 'name';
$code = 'code';
$status = 'status';
$description = 'description';
$createdSince = 'created_since';
$createdUntil = 'created_until';

$result = $subscriptions->getSubscriptionItems($subscriptionId, $page, $size, $name, $code, $status, $description, $createdSince, $createdUntil);

错误

方法: updateSubscriptionBillingDate

更新订阅的账单日期

function updateSubscriptionBillingDate(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsBillingDateRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionBillingDate($subscriptionId, $body, $idempotencyKey);

错误

方法: updateLatestPeriodEndAt

更新最新周期的结束时间

function updateLatestPeriodEndAt(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsPeriodsLatestEndAtRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateLatestPeriodEndAt($subscriptionId, $body, $idempotencyKey);

错误

方法: updateSubscriptionAffiliationId

更新订阅的联盟ID

function updateSubscriptionAffiliationId(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsGatewayAffiliationIdRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionAffiliationId($subscriptionId, $body, $idempotencyKey);

错误

方法: deleteSubscriptionItem

删除订阅项

function deleteSubscriptionItem(
        $subscriptionId,
        $subscriptionItemId,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$subscriptionItemId = 'subscription_item_id';
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->deleteSubscriptionItem($subscriptionId, $subscriptionItemId, $idempotencyKey);

错误

方法: 更新订阅卡

更新订阅中的信用卡信息

function updateSubscriptionCard(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsCardRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionCard($subscriptionId, $body, $idempotencyKey);

错误

方法: 更新订阅元数据

更新订阅的元数据

function updateSubscriptionMetadata(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsMetadataRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionMetadata($subscriptionId, $body, $idempotencyKey);

错误

方法: 更新订阅的账单到期日

更新订阅的账单到期天数

function updateSubscriptionDueDays(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new UpdateSubscriptionDueDaysRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionDueDays($subscriptionId, $body, $idempotencyKey);

错误

方法: 获取折扣

获取折扣

function getDiscounts(
        $subscriptionId,
        $page,
        $size)

参数

示例用法

$subscriptionId = 'subscription_id';
$page = 83;
$size = 83;

$result = $subscriptions->getDiscounts($subscriptionId, $page, $size);

错误

方法: 创建增量

创建增量

function createIncrement(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsIncrementsRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->createIncrement($subscriptionId, $body, $idempotencyKey);

错误

方法: 通过ID获取折扣

通过ID获取折扣

function getDiscountById(
        $subscriptionId,
        $discountId)

参数

示例用法

$subscriptionId = 'subscription_id';
$discountId = 'discountId';

$result = $subscriptions->getDiscountById($subscriptionId, $discountId);

错误

方法: 更新订阅最低价

更新订阅最低价

function updateSubscriptionMiniumPrice(
        $subscriptionId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$body = new SubscriptionsMinimumPriceRequest();
$idempotencyKey = 'idempotency-key';

$result = $subscriptions->updateSubscriptionMiniumPrice($subscriptionId, $body, $idempotencyKey);

错误

方法: 获取使用报告

获取使用报告

function getUsageReport(
        $subscriptionId,
        $periodId)

参数

示例用法

$subscriptionId = 'subscription_id';
$periodId = 'period_id';

$result = $subscriptions->getUsageReport($subscriptionId, $periodId);

错误

方法: 更新拆分订阅

更新拆分订阅

function updateSplitSubscription(
        $id,
        $body)

参数

示例用法

$id = 'id';
$body = new UpdateSubscriptionSplitRequest();

$result = $subscriptions->updateSplitSubscription($id, $body);

错误

返回控制器列表

类: OrdersController

获取单例实例

可以通过API客户端访问OrdersController类的单例实例。

$orders = $client->getOrders();

方法: updateOrderStatus

更新订单状态

function updateOrderStatus(
        $id,
        $body,
        $idempotencyKey = null)

参数

示例用法

$id = 'id';
$body = new UpdateOrderStatusRequest();
$idempotencyKey = 'idempotency-key';

$result = $orders->updateOrderStatus($id, $body, $idempotencyKey);

错误

方法: deleteAllOrderItems

删除所有订单项

function deleteAllOrderItems(
        $orderId,
        $idempotencyKey = null)

参数

示例用法

$orderId = 'orderId';
$idempotencyKey = 'idempotency-key';

$result = $orders->deleteAllOrderItems($orderId, $idempotencyKey);

错误

方法: createOrderItem

创建订单项

function createOrderItem(
        $orderId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$orderId = 'orderId';
$body = new OrdersItemsRequest();
$idempotencyKey = 'idempotency-key';

$result = $orders->createOrderItem($orderId, $body, $idempotencyKey);

错误

方法: updateOrderMetadata

更新订单的元数据

function updateOrderMetadata(
        $orderId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$orderId = 'order_id';
$body = new OrdersMetadataRequest();
$idempotencyKey = 'idempotency-key';

$result = $orders->updateOrderMetadata($orderId, $body, $idempotencyKey);

错误

方法: getOrders

获取所有订单

function getOrders(
        $page = null,
        $size = null,
        $code = null,
        $status = null,
        $createdSince = null,
        $createdUntil = null,
        $customerId = null)

参数

示例用法

$page = 175;
$size = 175;
$code = 'code';
$status = 'status';
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");
$customerId = 'customer_id';

$result = $orders->getOrders($page, $size, $code, $status, $createdSince, $createdUntil, $customerId);

错误

方法: createOrder

创建新订单

function createOrder(
        $body,
        $idempotencyKey = null)

参数

示例用法

$body = new OrdersRequest();
$idempotencyKey = 'idempotency-key';

$result = $orders->createOrder($body, $idempotencyKey);

错误

方法: deleteOrderItem

删除订单项

function deleteOrderItem(
        $orderId,
        $itemId,
        $idempotencyKey = null)

参数

示例用法

$orderId = 'orderId';
$itemId = 'itemId';
$idempotencyKey = 'idempotency-key';

$result = $orders->deleteOrderItem($orderId, $itemId, $idempotencyKey);

错误

方法: getOrderItem

获取订单项

function getOrderItem(
        $orderId,
        $itemId)

参数

示例用法

$orderId = 'orderId';
$itemId = 'itemId';

$result = $orders->getOrderItem($orderId, $itemId);

错误

方法: updateOrderItem

更新订单项

function updateOrderItem(
        $orderId,
        $itemId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$orderId = 'orderId';
$itemId = 'itemId';
$body = new OrdersItemsRequest1();
$idempotencyKey = 'idempotency-key';

$result = $orders->updateOrderItem($orderId, $itemId, $body, $idempotencyKey);

错误

方法: getOrder

获取订单

function getOrder($orderId)

参数

示例用法

$orderId = 'order_id';

$result = $orders->getOrder($orderId);

错误

返回控制器列表

类: PlansController

获取单例实例

API客户端可以访问PlansController类的单例实例。

$plans = $client->getPlans();

方法: updatePlanItem

更新计划项目

function updatePlanItem(
        $planId,
        $planItemId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$planId = 'plan_id';
$planItemId = 'plan_item_id';
$body = new PlansItemsRequest();
$idempotencyKey = 'idempotency-key';

$result = $plans->updatePlanItem($planId, $planItemId, $body, $idempotencyKey);

错误

方法: deletePlanItem

从计划中删除项目

function deletePlanItem(
        $planId,
        $planItemId,
        $idempotencyKey = null)

参数

示例用法

$planId = 'plan_id';
$planItemId = 'plan_item_id';
$idempotencyKey = 'idempotency-key';

$result = $plans->deletePlanItem($planId, $planItemId, $idempotencyKey);

错误

方法: getPlanItem

获取计划项目

function getPlanItem(
        $planId,
        $planItemId)

参数

示例用法

$planId = 'plan_id';
$planItemId = 'plan_item_id';

$result = $plans->getPlanItem($planId, $planItemId);

错误

方法: createPlanItem

将新项目添加到计划中

function createPlanItem(
        $planId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$planId = 'plan_id';
$body = new PlansItemsRequest1();
$idempotencyKey = 'idempotency-key';

$result = $plans->createPlanItem($planId, $body, $idempotencyKey);

错误

方法: getPlans

获取所有计划

function getPlans(
        $page = null,
        $size = null,
        $name = null,
        $status = null,
        $billingType = null,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$page = 175;
$size = 175;
$name = 'name';
$status = 'status';
$billingType = 'billing_type';
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");

$result = $plans->getPlans($page, $size, $name, $status, $billingType, $createdSince, $createdUntil);

错误

方法: createPlan

创建新计划

function createPlan(
        $body,
        $idempotencyKey = null)

参数

示例用法

$body = new PlansRequest();
$idempotencyKey = 'idempotency-key';

$result = $plans->createPlan($body, $idempotencyKey);

错误

方法: getPlan

获取计划

function getPlan($planId)

参数

示例用法

$planId = 'plan_id';

$result = $plans->getPlan($planId);

错误

方法: updatePlan

更新计划

function updatePlan(
        $planId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$planId = 'plan_id';
$body = new PlansRequest1();
$idempotencyKey = 'idempotency-key';

$result = $plans->updatePlan($planId, $body, $idempotencyKey);

错误

方法: deletePlan

删除计划

function deletePlan(
        $planId,
        $idempotencyKey = null)

参数

示例用法

$planId = 'plan_id';
$idempotencyKey = 'idempotency-key';

$result = $plans->deletePlan($planId, $idempotencyKey);

错误

方法: updatePlanMetadata

从计划更新元数据

function updatePlanMetadata(
        $planId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$planId = 'plan_id';
$body = new PlansMetadataRequest();
$idempotencyKey = 'idempotency-key';

$result = $plans->updatePlanMetadata($planId, $body, $idempotencyKey);

错误

返回控制器列表

类: InvoicesController

获取单例实例

API客户端可以访问 InvoicesController 类的单例实例。

$invoices = $client->getInvoices();

方法: createInvoice

创建发票

function createInvoice(
        $subscriptionId,
        $cycleId,
        $idempotencyKey = null,
        $body = null)

参数

示例用法

$subscriptionId = 'subscription_id';
$cycleId = 'cycle_id';
$idempotencyKey = 'idempotency-key';
$body = new SubscriptionsCyclesPayRequest();

$result = $invoices->createInvoice($subscriptionId, $cycleId, $idempotencyKey, $body);

错误

方法: getPartialInvoice

获取部分发票

function getPartialInvoice($subscriptionId)

参数

示例用法

$subscriptionId = 'subscription_id';

$result = $invoices->getPartialInvoice($subscriptionId);

错误

方法: updateInvoiceStatus

更新发票状态

function updateInvoiceStatus(
        $invoiceId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$invoiceId = 'invoice_id';
$body = new UpdateCurrentCycleStatusRequest();
$idempotencyKey = 'idempotency-key';

$result = $invoices->updateInvoiceStatus($invoiceId, $body, $idempotencyKey);

错误

方法: getInvoice

获取发票

function getInvoice($invoiceId)

参数

示例用法

$invoiceId = 'invoice_id';

$result = $invoices->getInvoice($invoiceId);

错误

方法: cancelInvoice

取消发票

function cancelInvoice(
        $invoiceId,
        $idempotencyKey = null)

参数

示例用法

$invoiceId = 'invoice_id';
$idempotencyKey = 'idempotency-key';

$result = $invoices->cancelInvoice($invoiceId, $idempotencyKey);

错误

方法: updateInvoiceMetadata

从发票更新元数据

function updateInvoiceMetadata(
        $invoiceId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$invoiceId = 'invoice_id';
$body = new InvoicesMetadataRequest();
$idempotencyKey = 'idempotency-key';

$result = $invoices->updateInvoiceMetadata($invoiceId, $body, $idempotencyKey);

错误

方法: getInvoices

获取所有发票

function getInvoices(
        $page = null,
        $size = null,
        $code = null,
        $customerId = null,
        $subscriptionId = null,
        $createdSince = null,
        $createdUntil = null,
        $status = null,
        $dueSince = null,
        $dueUntil = null,
        $customerDocument = null)

参数

示例用法

$page = 11;
$size = 11;
$code = 'code';
$customerId = 'customer_id';
$subscriptionId = 'subscription_id';
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");
$status = 'status';
$dueSince = date("D M d, Y G:i");
$dueUntil = date("D M d, Y G:i");
$customerDocument = 'customer_document';

$result = $invoices->getInvoices($page, $size, $code, $customerId, $subscriptionId, $createdSince, $createdUntil, $status, $dueSince, $dueUntil, $customerDocument);

错误

返回控制器列表

类: CustomersController

获取单例实例

API客户端可以访问 CustomersController 类的单例实例。

$customers = $client->getCustomers();

方法: createAccessToken

为顾客创建访问令牌

function createAccessToken(
        $customerId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$body = new CustomersAccessTokensRequest();
$idempotencyKey = 'idempotency-key';

$result = $customers->createAccessToken($customerId, $body, $idempotencyKey);

错误

方法: getAccessTokens

获取一个顾客的所有访问令牌

function getAccessTokens(
        $customerId,
        $page = null,
        $size = null)

参数

示例用法

$customerId = 'customer_id';
$page = 11;
$size = 11;

$result = $customers->getAccessTokens($customerId, $page, $size);

错误

方法: updateCustomer

更新顾客信息

function updateCustomer(
        $customerId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$body = new CustomersRequest();
$idempotencyKey = 'idempotency-key';

$result = $customers->updateCustomer($customerId, $body, $idempotencyKey);

错误

方法: getCustomer

获取顾客信息

function getCustomer($customerId)

参数

示例用法

$customerId = 'customer_id';

$result = $customers->getCustomer($customerId);

错误

方法: deleteAccessTokens

删除顾客的访问令牌

function deleteAccessTokens($customerId)

参数

示例用法

$customerId = 'customer_id';

$result = $customers->deleteAccessTokens($customerId);

错误

方法: getAddresses

获取顾客的所有地址

function getAddresses(
        $customerId,
        $page = null,
        $size = null)

参数

示例用法

$customerId = 'customer_id';
$page = 11;
$size = 11;

$result = $customers->getAddresses($customerId, $page, $size);

错误

方法: createAddress

为顾客创建新地址

function createAddress(
        $customerId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$body = new CustomersAddressesRequest();
$idempotencyKey = 'idempotency-key';

$result = $customers->createAddress($customerId, $body, $idempotencyKey);

错误

方法: getAccessToken

获取顾客的访问令牌

function getAccessToken(
        $customerId,
        $tokenId)

参数

示例用法

$customerId = 'customer_id';
$tokenId = 'token_id';

$result = $customers->getAccessToken($customerId, $tokenId);

错误

方法: deleteAccessToken

删除顾客的访问令牌

function deleteAccessToken(
        $customerId,
        $tokenId,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$tokenId = 'token_id';
$idempotencyKey = 'idempotency-key';

$result = $customers->deleteAccessToken($customerId, $tokenId, $idempotencyKey);

错误

方法: getAddress

获取顾客的地址

function getAddress(
        $customerId,
        $addressId)

参数

示例用法

$customerId = 'customer_id';
$addressId = 'address_id';

$result = $customers->getAddress($customerId, $addressId);

错误

方法: updateAddress

更新地址

function updateAddress(
        $customerId,
        $addressId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$addressId = 'address_id';
$body = new CustomersAddressesRequest1();
$idempotencyKey = 'idempotency-key';

$result = $customers->updateAddress($customerId, $addressId, $body, $idempotencyKey);

错误

方法: deleteAddress

删除客户的地址

function deleteAddress(
        $customerId,
        $addressId,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$addressId = 'address_id';
$idempotencyKey = 'idempotency-key';

$result = $customers->deleteAddress($customerId, $addressId, $idempotencyKey);

错误

方法: createCard

为客户创建新卡片

function createCard(
        $customerId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$body = new CustomersCardsRequest();
$idempotencyKey = 'idempotency-key';

$result = $customers->createCard($customerId, $body, $idempotencyKey);

错误

方法: getCards

获取客户的全部卡片

function getCards(
        $customerId,
        $page = null,
        $size = null)

参数

示例用法

$customerId = 'customer_id';
$page = 225;
$size = 225;

$result = $customers->getCards($customerId, $page, $size);

错误

方法: renewCard

更新卡片

function renewCard(
        $customerId,
        $cardId,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$cardId = 'card_id';
$idempotencyKey = 'idempotency-key';

$result = $customers->renewCard($customerId, $cardId, $idempotencyKey);

错误

方法: createCustomer

创建新客户

function createCustomer(
        $body,
        $idempotencyKey = null)

参数

示例用法

$body = new CustomersRequest1();
$idempotencyKey = 'idempotency-key';

$result = $customers->createCustomer($body, $idempotencyKey);

错误

方法: getCustomers

获取所有客户

function getCustomers(
        $name = null,
        $document = null,
        $page = 1,
        $size = 10,
        $email = null,
        $code = null)

参数

示例用法

$name = 'name';
$document = 'document';
$page = 1;
$size = 10;
$email = 'email';
$code = 'Code';

$result = $customers->getCustomers($name, $document, $page, $size, $email, $code);

错误

方法: updateCustomerMetadata

更新客户的元数据

function updateCustomerMetadata(
        $customerId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$body = new CustomersMetadataRequest();
$idempotencyKey = 'idempotency-key';

$result = $customers->updateCustomerMetadata($customerId, $body, $idempotencyKey);

错误

方法: updateCard

更新卡片

function updateCard(
        $customerId,
        $cardId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$cardId = 'card_id';
$body = new CustomersCardsRequest1();
$idempotencyKey = 'idempotency-key';

$result = $customers->updateCard($customerId, $cardId, $body, $idempotencyKey);

错误

方法: deleteCard

删除客户的卡片

function deleteCard(
        $customerId,
        $cardId,
        $idempotencyKey = null)

参数

示例用法

$customerId = 'customer_id';
$cardId = 'card_id';
$idempotencyKey = 'idempotency-key';

$result = $customers->deleteCard($customerId, $cardId, $idempotencyKey);

错误

方法: getCard

获取客户的卡片

function getCard(
        $customerId,
        $cardId)

参数

示例用法

$customerId = 'customer_id';
$cardId = 'card_id';

$result = $customers->getCard($customerId, $cardId);

错误

返回控制器列表

类: ChargesController

获取单例实例

可以通过API客户端访问ChargesController类的单例实例。

$charges = $client->getCharges();

方法: getCharge

根据ID获取收费信息

function getCharge($chargeId)

参数

示例用法

$chargeId = 'charge_id';

$result = $charges->getCharge($chargeId);

错误

方法: cancelCharge

取消收费

function cancelCharge(
        $chargeId,
        $idempotencyKey = null,
        $body = null)

参数

示例用法

$chargeId = 'charge_id';
$idempotencyKey = 'idempotency-key';
$body = new ChargesRequest();

$result = $charges->cancelCharge($chargeId, $idempotencyKey, $body);

错误

方法: confirmPayment

确认支付

function confirmPayment(
        $chargeId,
        $idempotencyKey = null,
        $body = null)

参数

示例用法

$chargeId = 'charge_id';
$idempotencyKey = 'idempotency-key';
$body = new CreateConfirmPaymentRequest();

$result = $charges->confirmPayment($chargeId, $idempotencyKey, $body);

错误

方法: updateChargeCard

更新收费的卡信息

function updateChargeCard(
        $chargeId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$chargeId = 'charge_id';
$body = new ChargesCardRequest();
$idempotencyKey = 'idempotency-key';

$result = $charges->updateChargeCard($chargeId, $body, $idempotencyKey);

错误

方法: getCharges

列出所有收费信息

function getCharges(
        $page = null,
        $size = null,
        $code = null,
        $status = null,
        $paymentMethod = null,
        $customerId = null,
        $orderId = null,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$page = 61;
$size = 61;
$code = 'code';
$status = 'status';
$paymentMethod = 'payment_method';
$customerId = 'customer_id';
$orderId = 'order_id';
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");

$result = $charges->getCharges($page, $size, $code, $status, $paymentMethod, $customerId, $orderId, $createdSince, $createdUntil);

错误

方法: retryCharge

重试收费

function retryCharge(
        $chargeId,
        $idempotencyKey = null)

参数

示例用法

$chargeId = 'charge_id';
$idempotencyKey = 'idempotency-key';

$result = $charges->retryCharge($chargeId, $idempotencyKey);

错误

方法: updateChargePaymentMethod

更新收费的支付方式

function updateChargePaymentMethod(
        $chargeId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$chargeId = 'charge_id';
$body = new ChargesPaymentMethodRequest();
$idempotencyKey = 'idempotency-key';

$result = $charges->updateChargePaymentMethod($chargeId, $body, $idempotencyKey);

错误

方法: updateChargeMetadata

更新收费的元数据

function updateChargeMetadata(
        $chargeId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$chargeId = 'charge_id';
$body = new ChargesMetadataRequest();
$idempotencyKey = 'idempotency-key';

$result = $charges->updateChargeMetadata($chargeId, $body, $idempotencyKey);

错误

方法: captureCharge

捕获收费

function captureCharge(
        $chargeId,
        $idempotencyKey = null,
        $body = null)

参数

示例用法

$chargeId = 'charge_id';
$idempotencyKey = 'idempotency-key';
$body = new ChargesCaptureRequest();

$result = $charges->captureCharge($chargeId, $idempotencyKey, $body);

错误

方法: updateChargeDueDate

从费用中更新到期日期

function updateChargeDueDate(
        $chargeId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$chargeId = 'charge_id';
$body = new ChargesDueDateRequest();
$idempotencyKey = 'idempotency-key';

$result = $charges->updateChargeDueDate($chargeId, $body, $idempotencyKey);

错误

方法: createCharge

创建新的费用

function createCharge(
        $body,
        $idempotencyKey = null)

参数

示例用法

$body = new ChargesRequest1();
$idempotencyKey = 'idempotency-key';

$result = $charges->createCharge($body, $idempotencyKey);

错误

方法: getChargeTransactions

GetChargeTransactions

function getChargeTransactions(
        $chargeId,
        $page = null,
        $size = null)

参数

示例用法

$chargeId = 'charge_id';
$page = 61;
$size = 61;

$result = $charges->getChargeTransactions($chargeId, $page, $size);

错误

方法: getChargesSummary

GetChargesSummary

function getChargesSummary(
        $status,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$status = 'status';
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");

$result = $charges->getChargesSummary($status, $createdSince, $createdUntil);

错误

返回控制器列表

类: RecipientsController

获取单例实例

从API客户端可以访问 RecipientsController 类的单例实例。

$recipients = $client->getRecipients();

方法: updateRecipientMetadata

更新接收者元数据

function updateRecipientMetadata(
        $recipientId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$recipientId = 'recipient_id';
$body = new RecipientsMetadataRequest();
$idempotencyKey = 'idempotency-key';

$result = $recipients->updateRecipientMetadata($recipientId, $body, $idempotencyKey);

错误

方法: updateRecipientTransferSettings

UpdateRecipientTransferSettings

function updateRecipientTransferSettings(
        $recipientId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$recipientId = 'recipient_id';
$body = new UpdateTransferSettingsRequest();
$idempotencyKey = 'idempotency-key';

$result = $recipients->updateRecipientTransferSettings($recipientId, $body, $idempotencyKey);

错误

方法: getAnticipation

获取预期值

function getAnticipation(
        $recipientId,
        $anticipationId)

参数

示例用法

$recipientId = 'recipient_id';
$anticipationId = 'anticipation_id';

$result = $recipients->getAnticipation($recipientId, $anticipationId);

错误

方法: getRecipients

检索分页的接收者信息

function getRecipients(
        $page = null,
        $size = null)

参数

示例用法

$page = 61;
$size = 61;

$result = $recipients->getRecipients($page, $size);

错误

方法: createRecipient

创建新的接收者

function createRecipient(
        $body,
        $idempotencyKey = null)

参数

示例用法

$body = new RecipientsRequest();
$idempotencyKey = 'idempotency-key';

$result = $recipients->createRecipient($body, $idempotencyKey);

错误

方法: getBalance

获取接收者的余额信息

function getBalance($recipientId)

参数

示例用法

$recipientId = 'recipient_id';

$result = $recipients->getBalance($recipientId);

错误

方法: getAnticipations

从一个收件人获取分页的期待列表

function getAnticipations(
        $recipientId,
        $page = null,
        $size = null,
        $status = null,
        $timeframe = null,
        $paymentDateSince = null,
        $paymentDateUntil = null,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$recipientId = 'recipient_id';
$page = 153;
$size = 153;
$status = 'status';
$timeframe = 'timeframe';
$paymentDateSince = date("D M d, Y G:i");
$paymentDateUntil = date("D M d, Y G:i");
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");

$result = $recipients->getAnticipations($recipientId, $page, $size, $status, $timeframe, $paymentDateSince, $paymentDateUntil, $createdSince, $createdUntil);

错误

方法: createAnticipation

创建一个期待

function createAnticipation(
        $recipientId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$recipientId = 'recipient_id';
$body = new RecipientsAnticipationsRequest();
$idempotencyKey = 'idempotency-key';

$result = $recipients->createAnticipation($recipientId, $body, $idempotencyKey);

错误

方法: updateRecipientDefaultBankAccount

更新收件人的默认银行账户

function updateRecipientDefaultBankAccount(
        $recipientId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$recipientId = 'recipient_id';
$body = new RecipientsDefaultBankAccountRequest();
$idempotencyKey = 'idempotency-key';

$result = $recipients->updateRecipientDefaultBankAccount($recipientId, $body, $idempotencyKey);

错误

方法: getRecipient

获取收件人信息

function getRecipient($recipientId)

参数

示例用法

$recipientId = 'recipient_id';

$result = $recipients->getRecipient($recipientId);

错误

方法: updateRecipient

更新收件人

function updateRecipient(
        $recipientId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$recipientId = 'recipient_id';
$body = new RecipientsRequest1();
$idempotencyKey = 'idempotency-key';

$result = $recipients->updateRecipient($recipientId, $body, $idempotencyKey);

错误

方法: getTransfer

获取转账

function getTransfer(
        $recipientId,
        $transferId)

参数

示例用法

$recipientId = 'recipient_id';
$transferId = 'transfer_id';

$result = $recipients->getTransfer($recipientId, $transferId);

错误

方法: getTransfers

获取收件人的分页转账列表

function getTransfers(
        $recipientId,
        $page = null,
        $size = null,
        $status = null,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$recipientId = 'recipient_id';
$page = 153;
$size = 153;
$status = 'status';
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");

$result = $recipients->getTransfers($recipientId, $page, $size, $status, $createdSince, $createdUntil);

错误

方法: createTransfer

为收件人创建转账

function createTransfer(
        $recipientId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$recipientId = 'recipient_id';
$body = new RecipientsTransfersRequest();
$idempotencyKey = 'idempotency-key';

$result = $recipients->createTransfer($recipientId, $body, $idempotencyKey);

错误

方法: getAnticipationLimits

获取收件人的期待限制

function getAnticipationLimits(
        $recipientId,
        $timeframe,
        $paymentDate)

参数

示例用法

$recipientId = 'recipient_id';
$timeframe = 'timeframe';
$paymentDate = date("D M d, Y G:i");

$result = $recipients->getAnticipationLimits($recipientId, $timeframe, $paymentDate);

错误

方法: createWithdraw

createWithdraw

function createWithdraw(
        $recipientId,
        $body)

参数

示例用法

$recipientId = 'recipient_id';
$body = new CreateWithdrawRequest();

$result = $recipients->createWithdraw($recipientId, $body);

错误

方法: getWithdrawals

获取收件人的分页转账列表

function getWithdrawals(
        $recipientId,
        $page = null,
        $size = null,
        $status = null,
        $createdSince = null,
        $createdUntil = null)

参数

示例用法

$recipientId = 'recipient_id';
$page = 153;
$size = 153;
$status = 'status';
$createdSince = date("D M d, Y G:i");
$createdUntil = date("D M d, Y G:i");

$result = $recipients->getWithdrawals($recipientId, $page, $size, $status, $createdSince, $createdUntil);

错误

方法: getWithdrawById

GetWithdrawById

function getWithdrawById(
        $recipientId,
        $withdrawalId)

参数

示例用法

$recipientId = 'recipient_id';
$withdrawalId = 'withdrawal_id';

$result = $recipients->getWithdrawById($recipientId, $withdrawalId);

错误

方法: updateAutomaticAnticipationSettings

更新接收者元数据

function updateAutomaticAnticipationSettings(
        $recipientId,
        $body,
        $idempotencyKey = null)

参数

示例用法

$recipientId = 'recipient_id';
$body = new UpdateAutomaticAnticipationSettingsRequest();
$idempotencyKey = 'idempotency-key';

$result = $recipients->updateAutomaticAnticipationSettings($recipientId, $body, $idempotencyKey);

错误

方法: getRecipientByCode

获取收件人信息

function getRecipientByCode($code)

参数

示例用法

$code = 'code';

$result = $recipients->getRecipientByCode($code);

错误

返回控制器列表

类: TokensController

获取单例实例

可以通过API客户端访问类的单例实例。

$tokens = $client->getTokens();

方法: createToken

标签: 跳过认证

CreateToken

function createToken(
        $publicKey,
        $body,
        $idempotencyKey = null,
        $appId = null)

参数

示例用法

$publicKey = 'public_key';
$body = new TokensRequest();
$idempotencyKey = 'idempotency-key';
$appId = 'appId';

$result = $tokens->createToken($publicKey, $body, $idempotencyKey, $appId);

错误

方法: getToken

标签: 跳过认证

根据ID获取令牌

function getToken(
        $id,
        $publicKey,
        $appId = null)

参数

示例用法

$id = 'id';
$publicKey = 'public_key';
$appId = 'appId';

$result = $tokens->getToken($id, $publicKey, $appId);

错误

返回控制器列表

类: TransactionsController

获取单例实例

可以通过API客户端访问类的单例实例。

$transactions = $client->getTransactions();

方法: getTransaction

GetTransaction

function getTransaction($transactionId)

参数

示例用法

$transactionId = 'transaction_id';

$result = $transactions->getTransaction($transactionId);

错误

返回控制器列表

类: TransfersController

获取单例实例

可以通过API客户端访问类的单例实例。

$transfers = $client->getTransfers();

方法: postCreateTransfer

创建转账

function postCreateTransfer($body)

参数

示例用法

$body = new CreateTransfer();

$result = $transfers->postCreateTransfer($body);

错误

方法: getTransferById

根据ID获取转账

function getTransferById($transferId)

参数

示例用法

$transferId = 'transfer_id';

$result = $transfers->getTransferById($transferId);

错误

方法: getTransfers1

获取所有转账

function getTransfers1()

示例用法

$result = $transfers->getTransfers1();

错误

返回控制器列表