#darkon7446

1 messages · Page 1 of 1 (latest)

vast oreBOT
round herald
#

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,]]
        );
reef phoenix
#

thank you, now i have this error: Invalid array

round herald
#

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,
                ]
        ]
);
reef phoenix
#

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.

round herald
#

yep, you need to pass the ID price_xxx of a Price that is not recurring.

reef phoenix
#

should i set a price data instead of price id?

round herald
#

since it's a one-off extra amount to add to the next invoice

round herald