#usmanparwaz
1 messages · Page 1 of 1 (latest)
Are you asking if we delete the API object after it's cancelled?
yes
after a subscription is deleted via API, did stripe remove it after some days or keeps the data?
Not in live mode, no. We do delete test objects after a certain time: https://support.stripe.com/questions/test-mode-subscription-data-retention
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.
ok thanks.
from stripe docs i have got a function
stripe.subscriptions.cancel
('sub_49ty4767H20z6a');
and when i practiced it, server is saying that it is not a function provided
so, is there any update or any istake on my side
What's the exact error?
(node:31554) UnhandledPromiseRejectionWarning: TypeError: stripe.subscriptions.cancel is not a function
How are you initialising your stripe client?
const stripe = require('stripe')(CREDS.STRIPE_SECRET_KEY, { apiVersion: '2020-08-27' });
key is test key
?
Hi! I'm taking over this thread.
Are you using the stripe-node library? If so, which version?
That version is from 2021. Could you upgrade to a newer version? The latest one is 13.3.0 https://github.com/stripe/stripe-node
then the docs will work fine ?
actually we have integrated it some years ago
if there would be not any issues of upgrading it then surely we will priortize it
because we are live now
Sorry I'm not sure I understand your quesiton
ok let me clear it
we are using version 8 and we are using subscription services in our project which is live.
Now, if we upgrade it to the latest version, will everything work fine or we have to under go some changes or testing the project with new version?
You can view the full changelog here: https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md
thank you so much
But the code you shared looks correct, to cancel a subscription it's stripe.subscriptions.cancel('sub_xxx)
yes its correct according to new version
its working fine with the old one, subscription.del