#boyyoka

1 messages · Page 1 of 1 (latest)

gaunt mirageBOT
plush storm
#

Hi there. Can you provide a little more context? Is this an active subscription? Why do you need to do this?

river grove
#

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

plush storm
#

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

river grove
#

Alrighty, thank you for your help!

plush storm
#

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

river grove
#

Is there any chance you could point me to the docs on how to manually mock the data?

plush storm
#

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

river grove
#

ah right!

plush storm
#

But since the event wouldn't come from stripe in this case, you'd need to temporarily disable signature verification

river grove
#

Yes, understood. Thank you so much