Simple Membership Plugin › Forums › Simple Membership Plugin › Stripe "charge.failed" event not processed
- This topic has 5 replies, 4 voices, and was last updated 4 years ago by
admin.
-
AuthorPosts
-
March 26, 2021 at 11:23 am #22316
Marc LP
ParticipantHello,
we have detected what it seems to be a small problem in your plugin.
Our site creates subscriptions using Stripe and Paypal. For now it has been working great.We’ve found a user whose subscription couldn’t be paid due a change in his credit card. Stripe notified the web via the “charge.failed” event, but the subscription was extended for one year as if he has paid.
We have tried locating where the “charge.failed” stripe event would be processed, but didn’t find it anywhere. We have seen “customer.subscription.deleted” and “charge.refunded” in swpm-stripe-subscription-ipn.php, but no “charge.failed”.
We think that should be addressed, as that member benefits for something he has not still paid.In Stripe we see that it is retrying the payment for some days. Maybe after some attemps it will cancel the subscription and then send an event to the website. Is this theory right?
So basically we don’t understand HOW that user got an extension of his subscription when the payment could not be made.
If you need any other info please tell us.
March 27, 2021 at 9:47 am #22323mbrsolution
ModeratorHi, thank you for reaching out to us. I have submitted a message to the developers to investigate this issue further.
Kind regards
March 28, 2021 at 1:26 am #22328admin
KeymasterSomething else happened on your site (some kind of hiccup/conflict somewhere) for that user’s profile to behave that way.
I have explained a little more in terms of how it works below so you can understand why we don’t need to look at the “charge.failed” event for the recurring payments.
Normally, the plugin waits for a SUCCESS charge. Only then it will extend the duration by updating the start date. If a successful charge is not received in time, then the profile gets set to “inactive”. It doesn’t matter if “charge is failed” because they won’t get the additional time until a successful payment is received.
It is normal for a subscription charge to fail sometimes (it can happen for a variety of reasons). Stripe will retry that charge again after 24 hours or so. After a few failures, the subscription will be cancelled which will trigger the other notification that the plugin will use to “block” the profile.
May 14, 2022 at 10:50 pm #23904GreenBandana
ParticipantWe have found this same behavior – for however many times Stripe attempts the credit card, the user’s account is extended one subscription period.
So if the credit card has changed and the card is tried 3 times before failing, the user’s subscription (in our case) is extended 3 years without any payment.
Is there any update here? We’re using 4.1.0. Thank you!
May 15, 2022 at 10:44 am #23905mbrsolution
Moderator@GreenBandana, this is a very old post. Can you start a new one please.
Thank you.
May 17, 2022 at 12:33 pm #23921admin
KeymasterThis was never an issue in the plugin. It doesn’t need to process a failed charge event for a normal setup since it has other mechanism to deal with that.
Normally, the plugin waits for a SUCCESS charge. Only then it will extend the duration by updating the start date. If a successful charge is not received in time, then the profile gets set to “inactive”. It doesn’t matter if “charge is failed” because they won’t get the additional time until a successful payment is received. When Stripe determines that the subscription has permanently failed, they will send a SEPARATE event which our plugin will handle and deactivate the user. So if you ask about the “failed” charge event, it won’t make any sense in the context of how our plugin works.
We want to process/handle a minimum number of webhooks to make sure it isn’t trying to process a high load of webhooks which will slow the site down. Stripe recommends processing the least number of webhooks.
-
AuthorPosts
- You must be logged in to reply to this topic.