#hasina_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1283699418796916778
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! that's because you have to 're-declare' the first existing phase, you can't just pass one phase for the "next" phase.
Hi, so i need to add in the phase items the 2 price of the product ? something like this :
$stripe->subscriptionSchedules->update(
$createPase->id,
[
'phases' => [
[
'items' => [
[
'price' => 'price_1Pxx0vFS5H5yq2Y0PzcNGM9z',
'quantity' => 1,
],
],
'iterations' => 1,
'start_date' => time(),
],
[
'items' => [
[
'price' => 'price_1PxviOFS5H5yq2Y0QVnClna5',
'quantity' => 1,
],
],
'iterations' => 1,
'start_date' => time('+1 month'),
],
],
]
);
well the start_date on the first phase should be subscription->current_period_start instead ideally. But yes that's the idea.
I'd also do "start_date" => $subscription->current_period_end, for the second phase so it starts exactly when the current month is over.
please could you help me! I have an other error message : There is a gap between phase 0 (1726129361, 1728721361) and phase 1 (1728721358, 1731399758).
the code is:
$stripe->subscriptionSchedules->update(
$createPase->id,
[
'phases' => [
[
'items' => [
[
'price' => 'price_1Pxx0vFS5H5yq2Y0PzcNGM9z',
'quantity' => 1,
],
],
'iterations' => 1,
"start_date" => 'now',
],
[
'items' => [
[
'price' => 'price_1PxviOFS5H5yq2Y0QVnClna5',
'quantity' => 1,
],
],
'start_date' => $subscribe->current_period_end,
],
],
]
);
i don' t understand the error message because i want to start now the price 'price_1Pxx0vFS5H5yq2Y0PzcNGM9z' and when its finished the iteration, the price price_1PxviOFS5H5yq2Y0QVnClna5 will star after
use start_date=>$subscribe->current_period_start on the first phase and it won't happen