voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.04k stars 287 forks source link

detect when the subscription is cancelled ? #294

Open muslemomar opened 4 years ago

muslemomar commented 4 years ago

Is there a way to let the Nodejs server know that the subscription is cancelled, for example getting a notification or something?

If not, how should I manage the cancellation of the user subscription 😕

Dellybro commented 4 years ago

Cancellation date should be attached as far as i know

jeebus3000 commented 4 years ago

Call iap.isCanceled on purchase data.

fndppx commented 4 years ago

Non-renewable subscription is support detect isCanceled??

chr4ss1 commented 4 years ago

ios and android both have server-to-server hooks that will notify you when user cancels. In order to check if it is cancelled, you just need to check if cancellationDate has been set.

if(receipt.cancellationDate) { /* it has expired */ }