PayPal does not support cancelling old S-* subscriptions from code/api’s. This means that either you (as a merchant) or the customer has to log in to PayPal’s API and cancel these subscriptions manually. #Pain.
Luckily – it can be automated using Phantom.js. Phantom.js is basically a rock solid webbrowser without a UI which you can program (JS) to do stuff for you. I have made a PayPal.js script which lets you input Email, Password and the old S- SubscriptionID you want to cancel.
Here’s how to use it:
- Download Phantom.js (2.0.0) – and Unpack it to a new folder – http://phantomjs.org
- Download PayPal.js and place it in the same folder
- Run phantomjs.exe –ssl-protocol=any paypal.js firstname.lastname@example.org MySecretPass S-123455634545234
- While it’s running – keep an eye on the folder. PNG screenshots will appear there providing you a peepshow of the progress.
- When done – your website will receive a IPN Callback from PayPal.