#ironbeard_unexpected

1 messages ยท Page 1 of 1 (latest)

graceful zenithBOT
#

๐Ÿ‘‹ 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/1319352416436621312

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

fallen osprey
#

I think a similar situation happened with this customer: cus_P6Oqfuss8VBqc7 (if you're able to verify that I'd appreciate the sanity check).

Thanks ๐Ÿ™‚

magic sorrel
#

Hi ๐Ÿ‘‹

Yeah, looking at that request you are both specifying billing_anchor_date: "now" and proration_behavior: "send_invoice" so that's going to generate a new invoice because you are changing the billing cycle

fallen osprey
#

Yeah ๐Ÿ™„ mistake on my part

magic sorrel
#

As for the customer.subscription.canceled event. let me double check something

fallen osprey
#

Thanks ๐Ÿ™‚

#

I think I found a third: cus_NN071ykkkZt6KR That should be all of them

magic sorrel
fallen osprey
#

Right. So 11/26/2024 was when they toggled "cancel at period end" which would have been Jan 16th 2025. So that's maybe why it says it'll cancel at 11/26/2025 (one year subscription).

#

So I have three people who tried to toggle their susbcriptiont to cancel at period end, but instead it generated a new invoice.

So I'm guessing I should just mark those invoices as Void, and set calendar reminders to unsubscribe their accounts on my server for the original date that it should have cancelled on.

magic sorrel
#

That way the Subscriptions will automatically cancel

#

But I would recommend building this scenario in test mode to test out the behavior.

fallen osprey
#

Oh nice! So two of them actually cancelled before it would auto-renew, and that original date has passed. Any idea if cancel_at can take a value in the past?

magic sorrel
#

No I don't think so.

#

Here's the def from the API ref

A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using proration_behavior. If set during a future period, this will always cause a proration for that period.

fallen osprey
#

I would feel more comfortable settign that for the one that should expire on Jan 16th if it didn't have an open invoice.

#

It does feel like I should void those three invoices though, since "This invoice was accidentally finalized or contains a mistake."

magic sorrel
#

Yeah that makes sense. Ultimately that would be up to how feel about communicating with your customers and what makes them whole

fallen osprey
#

Sounds good. Thanks so much!

#

I think I've got everything the way I need it except for this: sub_1MQupTCoTIfwbn287Q6LlBLu

#

I sent the cancel date to Jan 16th, 2025, which is what it should be. But I also want to make sure that a new invoice isn't billed to them on that date

magic sorrel
#

Yeah that's where I would recommend coding this scenario in Test mode and validating the behavior you want to see.

fallen osprey
#

Gotcha, I'll have to figure that out

magic sorrel
#

It's something I do as part of my work here so it's an approach I take pretty often.

What I would do is create a Customer (with a test clock) with the same kind of Subscription that is in the same state as your customer's before they made the update.

#

Then make the update to cancel at period end with the same configuration as the request you shared

fallen osprey
#

I guess I'm a little surprised that the status on that subscription didn't chansge to "cancelled" when I set the cancel date to Jan 16, 2025

magic sorrel
#

Well Jan 16, 2025 is still in the future

#

So we consider the Sub to be active until that date

fallen osprey
#

Oh, yes gotcha.

magic sorrel
#

Well Jan 16, 2025 is still in the future

Unless it isn't and I've been staring at my screen too long ๐Ÿ˜…

fallen osprey
#

hahaha, no I realized I had some code on my side that displays a "Cancels on <date>" if my local value of cancel_at_period_end is set to True, but for my local object that's not set.

#

I know I should test, but should I be concerned about this invoice showing up onthe dashboard?

magic sorrel
#

Okay that Invoice is being created because the new billing cycle goes until Nov 26. So this is crediting the customer for the unused time.

fallen osprey
#

Right. So, when they tried to cancel on Nov26 2024, a new billing cycile from Nov26 2024-Nov26 2025 was created. So even though I've set it to cancel on Jan 16th 2025, the billing cycle still remains until Nov26th.

Does it seem like Stripe would send out that zero dollar invoice via email?

magic sorrel
#

Yes I think we would notify the user of the credit

fallen osprey
#

Yeah, seems likely

#

hmm. okay. Thanks for all your help!

magic sorrel
#

Happy to do it ๐Ÿ™‚ It's why we're here.

#

And we get it. Billing is complex. There are unsecured footguns just lying around