When a user cancels are recurring payment in XF, does it stop payments in Paypal and Stripe?

Will Franco

Active member
For example, I signed up for an account on VRMB's forum. I get charged $45/mo for the subscription. If I cancel my subscription to the forum, will PayPal / Stripe stop charging the card on file?
 

Chris D

XenForo developer
Staff member
By default, XF doesn’t support cancelling PayPal recurring payments.

Maybe that’s functionality they’ve added but either way your best bet is to just log in to PayPal and make sure it is cancelled there.

With Stripe, you can cancel the recurring payment on the XF side.
 

mattrogowski

Well-known member
Just to jump in as I have the same query - is this because PayPal doesn't support this via the IPN, or it just isn't supported by XF?
 

beerForo

Well-known member
Just to jump in as I have the same query - is this because PayPal doesn't support this via the IPN, or it just isn't supported by XF?
The PP API was updated 10 years ago now. You can vote for XF to adopt it.
 

cdub

Well-known member
By default, XF doesn’t support cancelling PayPal recurring payments.

Maybe that’s functionality they’ve added but either way your best bet is to just log in to PayPal and make sure it is cancelled there.

With Stripe, you can cancel the recurring payment on the XF side.
What about stripe?

Also... Does it immediately cancel the upgrade or does it remain active until the expire date?
 

mattrogowski

Well-known member
As I understand, it wouldn't immediately cancel the upgrade in either case. If you've paid for a month and cancel the subscription after 2 weeks, you'd still get your first month. Once the subscription is cancelled, no new IPN/webhook comes in to renew it, so it will expire. The difference between Stripe and PayPal is that XF can send the cancellation request to Stripe, but not to PayPal.
 

cdub

Well-known member
As I understand, it wouldn't immediately cancel the upgrade in either case. If you've paid for a month and cancel the subscription after 2 weeks, you'd still get your first month. Once the subscription is cancelled, no new IPN/webhook comes in to renew it, so it will expire. The difference between Stripe and PayPal is that XF can send the cancellation request to Stripe, but not to PayPal.
I might do a test and see. I'll report back.
 

cdub

Well-known member
I might do a test and see. I'll report back.
Appears so!!! I'm leaving it active to see what happens when it renews tomorrow.

Screenshot_20210705-111222.png

I really wish an email would be sent out warning that the card is about to be charged to improve member relations.
 

mattrogowski

Well-known member
Looking through the code, Stripe does an API call to cancel the subscription but doesn't do anything with the actual purchased item, and the Cancel button for PayPal purchased upgrades links to https://www.paypal.com/cgi-bin/webscr?cmd=_manage-paylist. So the upgrade would expire via the cron that runs, and nothing would come in to re-activate it. Makes sense because you're cancelling the recurring subscription, things like Netflix keep you active for the current billing period too. I would imagine any payment email would come from the payment provider rather than XF.
 

Rasmus Vind

Well-known member
Looking through the code, Stripe does an API call to cancel the subscription but doesn't do anything with the actual purchased item, and the Cancel button for PayPal purchased upgrades links to https://www.paypal.com/cgi-bin/webscr?cmd=_manage-paylist. So the upgrade would expire via the cron that runs, and nothing would come in to re-activate it. Makes sense because you're cancelling the recurring subscription, things like Netflix keep you active for the current billing period too. I would imagine any payment email would come from the payment provider rather than XF.
Can you refer to places in the code where a paid recurring PayPal upgrade is detected cancelled? I have been looking for the past few days and couldn’t find any code that actually detects a cancelled subscription in PayPal.

Thanks in advance.
 

mattrogowski

Well-known member
Can you refer to places in the code where a paid recurring PayPal upgrade is detected cancelled? I have been looking for the past few days and couldn’t find any code that actually detects a cancelled subscription in PayPal.

Thanks in advance.
It doesn’t explicitly check if it’s been cancelled - if the subscription has been cancelled in PayPal, it will stop sending IPN postbacks, so XF will just expire the upgrade as it hasn’t been extended.
 

Rasmus Vind

Well-known member
Oh I see. Thank you for clarifying this. Is there a place where I configure this post back URL?

I had the feeling that a cancelled subscription was not tracked by XF. I’m glad that isn’t so.
 

digitalpoint

Well-known member
It can technically be done with the PayPal API. It's not quite as easy as setting up IPN notices (which doesn't require anything, just the URL). It's more like how if you want to allow people to log in with their Google account, the site owner needs to set up a Google Project to allow the OAuth to happen.

Basically the site owner would need to setup a PayPal Developer account... but yes, it's possible to manage PayPal subscriptions programmatically. https://developer.paypal.com/api/subscriptions/v1/#subscriptions_cancel
 

digitalpoint

Well-known member
It may be with a newer API, but I’m pretty sure the integration XF uses doesn’t support it.
Right... sorry, I should have said that. XenForo does not support canceling of PayPal subscriptions. However, if they were ever to implement use of the PayPal API, it could be done (even for existing subscriptions because the API used is tied to the PayPal account, not specific transactions that were setup with the API).
 

Rasmus Vind

Well-known member
We'll see what happens in 2.3. It's been long underway and will surely have something new and shiny to uncover.

Thanks for the attention after my reply. I was worried (I had read it somewhere and gotten the impression) that when someone cancels a subscription, that the forum wouldn't know. Now I feel more confident about things.
 

Gene Steinberg

Well-known member
There should be a way to use the proper API to allow canceling a subscription via XF. This is especially true for us because we offer several tiers of member upgrades, based on duration of each subscription payment (week, month, year, etc.), and it would be nice to allow one to just upgrade and cancel the lower-tier subscription as part of the same process.

Right now, it doesn't encourage people to move to a higher level, since they have to first visit PayPal to sort out their existing recurring payment.
 
Top