#mochihealth_api

1 messages · Page 1 of 1 (latest)

obtuse skyBOT
#

👋 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/1219832896374968350

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

tawny shaleBOT
worthy kestrel
#

Can you share your code and the error message?

hoary juniper
#

the types safety that stripe shipped in their sdk doesn't appear to know about the cancellation_details field

#

so I just want to be 100% sure that it exists

#

also is that the best way to actually know what the reason was for cancellation

worthy kestrel
#

Can you share your code and the stripe-node version you use?

hoary juniper
#

I'm just getting the event object that the customer.subscription.deleted event sends you and trying to access that field

#

how can I be sure that the subscription either got deleted because it was set to cancel at period end, payment failed or like a manual cancellation

#

how can I differentiate between those scenarios given the data on the subscription object

#

apiVersion: '2022-11-15',

worthy kestrel
#

cancellation_details is not a deprecated field: https://docs.stripe.com/api/subscriptions/object#subscription_object-cancellation_details

cancellation_details exists since stripe-node v11.14.0: https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md#11140---2023-03-09

It's likely that you're using older stripe-node version. I'd recommend updating to the latest version v14.21.0: https://github.com/stripe/stripe-node

GitHub

Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.

GitHub

Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.

hoary juniper
#

what happens if I update the stripe api version will anything break?

worthy kestrel
hoary juniper
#

I dont see a clear way to distinguish what actually triggered the subscription cancellation

worthy kestrel
hoary juniper
#

if I am using an older version of the stripe api will this field still exist event though the api version that I'm using does not know of its existence?