#usmanparwaz

1 messages · Page 1 of 1 (latest)

wild hareBOT
agile spindle
#

Are you asking if we delete the API object after it's cancelled?

true umbra
#

after a subscription is deleted via API, did stripe remove it after some days or keeps the data?

agile spindle
true umbra
#

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

agile spindle
#

What's the exact error?

true umbra
#

(node:31554) UnhandledPromiseRejectionWarning: TypeError: stripe.subscriptions.cancel is not a function

agile spindle
#

How are you initialising your stripe client?

true umbra
#

const stripe = require('stripe')(CREDS.STRIPE_SECRET_KEY, { apiVersion: '2020-08-27' });

#

key is test key

#

?

wise geyser
#

Hi! I'm taking over this thread.

true umbra
#

sure

#

so if i have to repeat it ?

wise geyser
#

Are you using the stripe-node library? If so, which version?

true umbra
#

yes

#

"stripe": "^8.165.0",

#

?

wise geyser
true umbra
#

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

wise geyser
#

Sorry I'm not sure I understand your quesiton

true umbra
#

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?

wise geyser
true umbra
#

thank you so much

wise geyser
#

But the code you shared looks correct, to cancel a subscription it's stripe.subscriptions.cancel('sub_xxx)

true umbra
#

yes its correct according to new version
its working fine with the old one, subscription.del