#boyyoka
1 messages · Page 1 of 1 (latest)
Hi there. Can you provide a little more context? Is this an active subscription? Why do you need to do this?
Hi, I'm currenly testing a flow to downgrade a subscription to a free tier when a user fails to pay for a paid subscription. I'm listening to the customer.subscription.update event to check its status to determine whether I should downgrade the subscription
Gotcha. So for an existing subscription this will be tricky if it's active. You can read more about the statuses of a sub here: https://stripe.com/docs/api/subscriptions/object#subscription_object-status but it will only reach unpaid status once all retry attempts have been exhausted (and your subscription settings are set to mark subs as unpaid). So you could create a new test sub, alter your subscription settings, and use a test card that declines payment
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Alrighty, thank you for your help!
No problem
Alternatively you can just mock up an event object that has the data you want and send it to your endpoint since this is just a test
You'd need to disable signature verification if you're just sending dummy data though
Is there any chance you could point me to the docs on how to manually mock the data?
There's no docs for it. I just mean taking the general structure of a customer.subscription.updated webhook event and putting the data you want in it and then use postman or some other tool to send it to your endpoint
ah right!
But since the event wouldn't come from stripe in this case, you'd need to temporarily disable signature verification
Yes, understood. Thank you so much