1 回答
TA貢獻(xiàn)1788條經(jīng)驗(yàn) 獲得超4個(gè)贊
在您的 php 調(diào)用中,您指定了phases參數(shù)兩次。因此只有第二個(gè)phases定義被用于創(chuàng)建訂閱計(jì)劃。此處的解決方法是將所有階段移動(dòng)到單個(gè)數(shù)組和參數(shù)下,如下所示:
$schedule = \Stripe\SubscriptionSchedule::create([
'customer' => $customer->id,
'start_date' => 'now',
'end_behavior' => 'cancel',
'phases' => [
[
'end_date' => 1592910720,
'proration_behavior' => 'none',
'plans' => [
[
'price_data' => [
'unit_amount' => 5000,
'currency' => 'usd',
'product' => $product->id,
'recurring' => [
'interval' => 'year',
],
],
],
],
],
[
'end_date' => 1594850400,
'proration_behavior' => 'none',
'plans' => [
[
'price_data' => [
'unit_amount' => 6000,
'currency' => 'usd',
'product' => $product->id,
'recurring' => [
'interval' => 'year',
],
],
],
],
],
],
]);
我看到的唯一區(qū)別是,在 Curl 請(qǐng)求中,我明確傳遞了階段編號(hào)。
更多的是你在 phases 數(shù)組中傳遞相位索引。您必須在 cURL 中明確說明這一點(diǎn),但在 php 中,您只需將每個(gè)元素添加到一個(gè)數(shù)組中,并且索引是隱含的。
- 1 回答
- 0 關(guān)注
- 267 瀏覽
添加回答
舉報(bào)
