#sevitom_unexpected
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/1241088153016733747
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Do you have example Subscription and Invoice IDs I can review?
Hi, do you mean ids from my test environment?
Yes
customer id: cus_Q7kHXZdQ3Ujkna
sub id: sub_1PHUn7HPBcGdUhQsr5psmX5s
invoice id: in_1PHUtGHPBcGdUhQsA8DX8snE
thanks for the help!
Okay so you generated an Invoice for $800 based on the accumulated usage at the time the subscription canceled. But 2 seconds after it was created, the invoice went to a state of closed_canceled
Does that sound right?
That sounds right, and that behavior is unexpected right?
The invoice creation and state change is triggered by cancellation caused by billing cycle end
Acutally no, I think that is expected. We don't say that this invoice will be auto-collected. Additionally we document
Canceling subscriptions disables creating new invoices for the subscription and stops automatic collection of all invoices from the subscription by setting auto_advance to false.
here: https://docs.stripe.com/billing/subscriptions/overview#cancel-subscriptions
I think this documentation says they should be collected? https://docs.stripe.com/billing/subscriptions/usage-based/pricing-models#cancellations
Also, If I do not set cancel_at_period_end through the API but instead set cancel_at_period_end through the stripe dashboard, it behaves as expected
I can give you ids for that case in a few minutes
This test gave me the same result
๐ฆ
its gotta be a stripe issue right?
stripe sim time*
it says right there in the UI they should be charged
But when you complete the action, the invoice is canceled instead?
At this point, the invoice isn't created yet, its "upcoming"
if i complete this action, nothing changes because the subscription is scheduled to cancel in the future
then i run stripe sim time to Jun 19 expecting the charge, but the state change you saw happens automatically
sub_1PHVUcHPBcGdUhQsVHcRNW3A
in_1PHVWMHPBcGdUhQsILhtB1xv
this is the second test I ran with the same result through the dashboard
Okay I need to check with a colleague. This might be an artifact of using Test clocks
Ok cool, that would be no problem
QQ have you tried to finalize and attempt payment on the invoice? It looks like the invoice is still in a status of draft
I have not
In terms of designing our system, we want to avoid doing that and use this automatic functionality
The Invoice will remain in draft status for 1 hour after being created. This timeline is not controlled by the test clock
Understood, so its 100% a test clock issue?
Not quite. Because auto_advance is disabled when the susbcription is canceled, it will be up to you to finalize and attempt payment.
I don't think thats right, all the documentation and even the UI says it should be automatically collected
I will try a test where I very carefully advance the sim clock really quick and get back to you
give me a few mins
Yea I'm not sure, I tried just advancing sim time an hour past the period end and got the same result
Can you clarify this part:
even the UI says it should be automatically collected
What are you reading/looking at that suggests this?
#1241088153016733747 message here in the screenshot below the option
Gotcha, this seems to be somewhat ambiguous in what the Dashboard suggests, since the invoice is generated, but the collection is not happening automatically due ot the cancelation. You can manually charge the customer using the invoice view in the dashboard, or finalize/pay via the API.
I would suggest writing in to our support team with the steps you followed and the mismatched description <> behaviour: https://support.stripe.com/contact
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I'm really not convinced, there are two places the functionality in phrased like the customer should be billed and its very conceivable to me its a corner case with Stripe Sim Time in test mode
why would it say in both places they will be "billed" but not collected?
"After you schedule the cancellation of a subscription using cancel_at_period_end, you can reactivate it at any point up to the end of the period by updating cancel_at_period_end to false. The final invoice includes any metered usage after the subscription cancels at the end of the billing period."
The final invoice includes any metered usage after the subscription cancels at the end of the billing period.
Which is does here, correct?
ie, the invoice is generated as you expect, but not automatically collecting, right?
Can we keep this thread open for a bit while I test? I swear I ran a case where it randomly worked, but I regularly delete my customers while testing so I can keep using sim time
what would be the point for the functionality if I had to manually send the invoice?
an invoice is always created at the end of the period regardless, so its not really any different from what normally happens if the subscription doesn't cancel at the end of its period
Yes please test this some more, consider a try using the API instead of the dashboard to see if that has an effect
Subscription: sub_1PHWa2HPBcGdUhQsYc34OiuT
Invoice: sub_1PHWa2HPBcGdUhQsYc34OiuT
Subscription is canceled due to cancellation at end of period
Invoice will be charged, that random state change that causes it not to be charge did not occur
Is there a dev maybe with a unit test or line of code they can look at and know the exact intended behavior? because Test Mode + Sim time is definitely giving mixed results
Yep, the team can definitely try to reproduce and investigate and if you write in with reproduction steps in the Dashboard that will kick that off
here you go
Start with a metered, monthly subscription that has an upcoming invoice with charged items in it.
Update Stripe Subscription to cancel_at_period_end at dashboard
Advance sim time past period end.
Invoice auto_advance set to false and never charged
Yep, I recommend sharing those steps via writing in here so our team can investigate: https://support.stripe.com/contact/email
In the interim, you should /finalize these invoices manually, either via the Dashboard or API
ok thanks for the help