Stripe Subscription Cancellation at renewal causes early EOT demotion

For Stripe subscriptions, when renewal time hits, the draft invoice is created 1 hour before payment is done.

Sometimes a user cancels during that 1 hour:

In this case what happened was that the payment goes through half an hour after they had cancelled. This is unexpected for the user. What was even more unexpected was that the user was demoted as though they had successfully cancelled before payment, just five minutes after the payment:
“Demoted by s2Member: Mon Sep 14, 2020 2:00 pm UTC”
The timeline looks like this:
12:54 - Invoice drafted
13:34 - User cancels subscription
13:55 - Invoice is paid
14:00 - User is demoted.

I think this may be an edge case that is not being handled properly.

Here is another case where the same thing happened:

Draft invoice is created, user cancels, invoice is paid, user still gets demoted.

It’s a double whammy of being charged another month after cancelling, then not even getting the benefit of the extra month.

wow, that’s really edge case… Thanks for catching it!

So the invoice got drafted by Stripe because the charge time was about to come up in the subscription, user cancels the subscription, but now the invoice is charged while the subscription is ended. Is that correct?

I will have to see if Stripe lets me see if the user has an invoice already created for the subscription being cancelled, so it can be removed too…

Thank you for your attention on this issue!

So the invoice got drafted by Stripe because the charge time was about to come up in the subscription, user cancels the subscription, but now the invoice is charged while the subscription is ended. Is that correct?

Yes, that is correct.

I don’t know if this is helpful, but this item in the Stripe docs talks about how subscription renewal creates a draft invoice one hour before paying the invoice: https://stripe.com/docs/billing/invoices/subscription#subscription-renewal

1 Like

Correct. That’s exactly what’s happening.

What is incorrect from Stripe, in my opinion, is that having cancelled the subscription, doesn’t prevent the invoice from getting charged. I may bring it up with the Stripe developers, but in the meantime I will see if I can just make s2 removed it with the cancellation.

Like you said, very unusual scenario, so not urgent to address, but still worth preventing.

@clavaque Thank you for looking into this, I hope you can find a solution! Although only small percentage are affected, when it happens it is high impact because of how bad it feels from the client’s perspective.

1 Like

Here is another case:

A similar, but different case.

Unlike the other cases, the customer canceled the subscription AFTER the 1 hour window. The first payment attempt failed. Even though the subscription was cancelled, the invoice was not voided, and more payment attempts were made. Similar to the other cases, the EOT still happened even though payment was pending.

I got another case like the above, where someone cancels AFTER the 1 hour window, and AFTER the first payment attempt fails. Even though the subscription was cancelled, the invoice was not voided, and more payment attempts were made. Similar to the other cases, the EOT still happened even though payment was pending.

In this case, a subsequent payment attempt succeeded. So the customer is charged for another cycle, even though they already cancelled. And they don’t even get the benefit of access for the paid-for, unwanted, cycle because of the EOT

Thank you so much for the updates with extra info. I’m looking into this and hope to get back to you with more insight soon. :slight_smile:

Thank you Cristian!

1 Like
  1. would like to draw attention to stripe integration of s2Members pro. Is it SCA ready?
    As per the list shared by stripe today by way of explanation - S2Members including its Pro version are not SCA compliant. Please see https://stripe.com/partners/sca-ready
    In absence of compliance, transactions via stripe are being prevented in other plugins similarly integrating to stripe.
    Stripe suggests moving away from plugins that do not help.
  2. When I logged in once into the S2 Member Pro’s support group I could not click the pro support link. Later I found that S2 Member Pro’s support group login is not working any further
    No confirmatory email is being sent when seeking to log in with forgot password. Since password cannot be seen hence error not rectified. I could not log in despite several tries. Finally, opened a new account to login.

SGhos

Hi SGhos.

s2Member Pro’s Stripe integration has been SCA ready since over a year ago now. In my Stripe account used with s2Member, the Updates page confirms it. https://dashboard.stripe.com/sca-update

Screenshot_2020-12-09%20Updates%20%E2%80%93%20s2Member%20CH%20%E2%80%93%20Stripe

:slight_smile:

1 Like

Hi Alan,

I finally got back to this issue. Have you seen it happen again since then? I still haven’t reached a solution, but a’m in touch with the Stripe guys asking them for help.

They tell me they need the subscription and invoice IDs to review on their side and understand what happened there. Could you please provide me the IDs of the subscriptions you had that problem with? and their corresponding invoice IDs for that last charge, please. If you could match them to the screenshots you showed me, that’d be even better, because they had different sequences of events, and that way I’ll be able to know which I’m talking about with the Stripe developer.

I look forward to your update with that! :slight_smile:

Well, I made further progress with what I had, and I think I improved it enough to avoid most of the cases you mentioned.

Now, on cancellation, I check the latest invoice to see if it’s open or a draft, and void it, so there’s no chance it’ll be charged later. Haven’t had issues in my last tests.

It will be in the coming release, but if you would like to start using it right away, and give me feedback, like if you see the behavior happen again, I’d really appreciate it.

Here’s the file:
stripe-utilities-210121-beta.zip (11.4 KB)

It goes here: s2member-pro/src/includes/classes/gateways/stripe/stripe-utilities.inc.php

I look forward to hearing from you. :slight_smile:

I asked our support staff about it yesterday and there has been at least 1 case of each (1) Draft invoice still charged after cancelation and (2) Failed payment invoice still charged after cancelation in recent times.

FYI (1) became less frequent after September because I put in a warning message for students who tried to cancel within one hour of their billing time, letting them know that they may still be charged despite canceling and to contact support.

Thank you so much for creating a fix! I applied the fix to our install and asked our support staff to keep an eye out for (1) and (2).

1 Like