通过Braintree API设置计费周期数


Set the Number of Billing Cycles via the Braintree API

我正在我们的网站中实现Braintree Payments,在尝试创建订阅时遇到了问题。我想覆盖自定义订阅的"计划"详细信息。我正在尝试使用PHP通过API设置"计费周期数"。我似乎无法让它发挥作用。在API文档中,它写道:"您可以覆盖计划价格、试用期、开始日期、每次订阅的计费周期数以及附加组件和折扣详细信息。"以下是链接:https://www.braintreepayments.com/docs/php/subscriptions/create#overriding_plan_details

$result = Braintree_Subscription::create(array(
         'paymentMethodToken' => $payment_method_token,
         'planId' => 'r45g',
         'price' => "{$_SESSION['enroll-draft-amount']}",
         'billingCycles' => '7'
    ));

此billingCycles设置不起作用。有人知道正确的设置是什么吗?

感谢

我想明白了。希望这能帮助其他人。正确的设置是:numberOfBillingCycles