0

https://github.com/jforrest/Chargify-PHP-Clientで説明されている php chargify コネクタを使用しており、サブスクリプションの next_billing_at パラメータを更新したいと考えています。私はこのようにしてみました:

$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>";

日付を「2013-04-20」として渡そうとしましたが、それもうまくいきませんでした。APIを利用してchargifyの請求日を更新することはできますか?

4

1 に答える 1

2

配列が次のようになることを除いて、正しい考えがあります。

$requestArr = array(
    'subscription' => array(
        'customer_id' => $thisCustomerID,
        'next_billing_at' => '2013-04-20'
    )
);

そして、あなたは良いはずです(テスト済み)

参照: http://docs.chargify.com/api-subscriptions#api-usage-json-subscriptions-update

于 2013-03-07T21:21:04.413 に答える