#hasina_webhooks

1 messages ¡ Page 1 of 1 (latest)

rotund viperBOT
#

👋 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.

jolly ice
#

hi! that's because you have to 're-declare' the first existing phase, you can't just pass one phase for the "next" phase.

worthy turtle
# jolly ice hi! that's because you have to 're-declare' the first existing phase, you can't ...

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'),
],
],
]
);

jolly ice
#

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.

worthy turtle
# jolly ice well the `start_date` on the first phase should be `subscription->current_period...

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

jolly ice
#

use start_date=>$subscribe->current_period_start on the first phase and it won't happen