如何使用php api更新chargify next_计费值?

如何使用php api更新chargify next_计费值?,php,api,subscription,billing,chargify,Php,Api,Subscription,Billing,Chargify,我正在使用中描述的php chargify连接器,我想更新订阅的下一个参数。我试着这样做: $requestArr = array('customer_id'=>"$thisCustomerID",'next_billing_at' => '2013-04-20T02:52:17-04:00'); try { $connector->requestUpdateSubscription($thisSubscriptionID, json_encode($requestAr

我正在使用中描述的php chargify连接器,我想更新订阅的下一个参数。我试着这样做:

$requestArr = array('customer_id'=>"$thisCustomerID",'next_billing_at' => '2013-04-20T02:52:17-04:00');
try {
    $connector->requestUpdateSubscription($thisSubscriptionID, json_encode($requestArr), $format = 'JSON');
} catch (ChargifyValidationException $cve) {
    //process error handling code here.
    echo $cve->getMessage();
}
但是,尽管没有验证例外情况,但当我随后检查下一个评估日期时,它没有改变:

$subscriptionUpdated = $connector->getSubscriptionsByID($thisSubscriptionID);
$newBillingDate = $subscriptionUpdated->next_assessment_at;
echo "new next billing date is $newBillingDate<br>";
$subscriptionUpdated=$connector->getSubscriptionsByID($thisSubscriptionID);
$newBillingDate=$subscriptionUpdated->next\u assessment\u at;
echo“新的下一个计费日期为$newBillingDate
”;

我试着把日期改为“2013-04-20”,但也没用。是否可以使用API更新chargify中的计费日期?

您的想法是正确的,但您的阵列应该如下所示:

$requestArr = array(
    'subscription' => array(
        'customer_id' => $thisCustomerID,
        'next_billing_at' => '2013-04-20'
    )
);
然后你应该是优秀的(经过测试的)


参考资料:

耶!谢谢你,詹姆斯!我刚刚将上面的第一行更改为$requestArr['subscription']=array('customer\u id'=>“$thisCustomerID”,'next\u billing\u at'=>'2013-04-20T02:52:17-04:00');而且它工作得很好