#darkon7446
1 messages · Page 1 of 1 (latest)
it should be in the first argument
$stripe->subscriptions->update(
$idsub,
['add_invoice_items'=>['price' => 'price_1O0KXJFK2RqcP62sf2ErmQPz','quantity' => 1],
'pending_invoice_item_interval'=> ['interval' => 'day','interval_count' => 1,]]
);
thank you, now i have this error: Invalid array
yeah because your add_invoice_items is wrong too, it needs to be an array of objects
[ [...], [...] ]
overall it should look like this
$stripe->subscriptions->update(
$idsub,
[
'add_invoice_items'=>[
[
'price' => 'price_1O0KXJFK2RqcP62sf2ErmQPz','quantity' => 1
]
],
'pending_invoice_item_interval'=> [
'interval' => 'day',
'interval_count' => 1,
]
]
);
ok thank you now it works, i have another error but it's different
The price specified is set to type=recurring but this field only accepts prices with type=one_time.
yep, you need to pass the ID price_xxx of a Price that is not recurring.
should i set a price data instead of price id?
since it's a one-off extra amount to add to the next invoice
you can if you wish, or you can create a Price previously that is one-time, and pass the ID of that.