#yaroslavmokhurenko_code

1 messages ¡ Page 1 of 1 (latest)

brisk heraldBOT
#

👋 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/1349448151551185056

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

solar bramble
#

In the question I meant to say subscription.trial_end. It was 11th but the stripe_invoice.lines.data.last.period.end was on 12th. and the subscription was charged on the 11th while we expected it to charge on the 12th.

fleet escarp
#

Hi, can you share more on why you expected 11th? Can you share a bit more?

solar bramble
#

no we expected 12th to be the next charge day because of the invoice.paid event's event.data.object.lines.data.last.period.end . this is the invoice id if you need in_1Qz8Rg2mVLBWWSll1VSQHOis.
So the invoice's .lines.data.last.period.end is 1741749392 and using our code Time.zone.at(1741749392).to_date it results in Wed, 12 Mar 2025.
But after the trial ended the charge on the card actually happened on 11 Mar 2025. I suspect it is because on the subscription object the subscription.trial_end is set to 1741693371 which is Tue, 11 Mar 2025. So we might wrongfully assume that invoice.lines.data.last.period.end is always going to be the date of the next charge.

#

This happened only for this user btw. When I try on my test user the trial_end date on the subscription and lines.data.last.period.end date on the trial invoice is the same.

fleet escarp
#

Thank you for the additional details, taking a look

brisk heraldBOT
fleet escarp
#

Did you mean to do that and end the trial with ' trial_end: "now",'?

#

That seems to be the culprit here, can you review this on your end please?

solar bramble
#

Yup. that is what happened. my bad. Thanks for your time