#amfpaulo_subscription-lifecycle-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/1338550946006958230
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there ๐ you'll have to use a test clock to test that:
https://docs.stripe.com/billing/testing/test-clocks
That will let you create a Subscription in a sandbox where you can advance time.
You'll need to also use this test card, which can successfully be attached to a Customer but then results in failed testmode payments:
4000 0000 0000 0341
https://docs.stripe.com/testing#:~:text=Decline after attaching
SO, not possible to use CLI ?
Hi ๐
I'm stepping in as my colleague needs to go.
We recommend stepping through the full process using the card number provided to ensure you can observe the complete behavior of the subscription process
Ok, I understand it, however I am trying to be quicker and more objective using Stripe CLI to simulate events. Is there a way for me to test subscriptions failing payments using CLI ?
A Subscription does not have failed payments, but Subscription Invoices do have failed payments. It's a minor but important distinction. So, to test this, you would want to trigger the invoice.payment_failed event
I uunderstand that, this was the test I did , however I noticed thare is a event : customer.subscription.updated, which I though could be part of the process , like, first the invoice payment will fail, and that subscription would be updates to past due or something, eventually if payment fails x times, the subscription would be updated to "canceled" .... I could not find this flow on the documentation
That is because the CLI is not intended to test complete flows
It is intended for simple, basic approaches
and doesn't include all events
This is a simple flow from my perspective
Ok, got it
Can you tell me where can I find the subscription fail flow ?
like, invoice fail -> sub updates, etc
I just told you. Build it and test it manually
Let me change my question
After Invoice Payment Fail, what is the next event stripe fires ?
There isn't a specific or guaranteed order to events. It is all highly dependent on your account settings and integration. Trying to build a checking system relying on CLI-triggered webhook events is a very bad idea for this reason.
I recommend you script scenarios instead, like using Test Clocks with Subscription & Customer objects to create a simulation of the behaviors you are trying to test for.