Massive number of webhook failures in Stripe

I recently had some issues with customers not being appropriately updated upon certain actions, so I logged into Stripe and discovered that I was having a massive number of failures of webhooks…a 99% error rate. A variety of event types are failing, like customer.subscription.updated or invoice.created.

The ones that have been succeeding are ones like “payout.paid” or “customer.card.updated” or “customer.card.created.”

The failures are coming back with an HTTP status of “unreachable.” The successes are coming back with a 200 (OK) code.

I’ll contact Stripe about this as well, but any idea what would be causing this? The webhook URL is correct.

1 Like

Further info from Stripe:

"After thorough checking, we’ve checked that your webhook error results are “time out” error. This means that something may be wrong your server and we didn’t receive a response quick enough so the request timed out. "

I can also see here that you’re using a webhook endpoint through a plugin, the best person to further check what caused the server/time out errors is your developer."

Hi James.

Did you have those since you started using s2 with Stripe, or was it fine until recently?

Did you verify that your integration is all correct? WP Admin > s2Member Pro > Stripe Options

Check that you can open your webhook URL (the one that ends in ?s2member_pro_stripe_notify=1) on your browser and not getting an error there. WP Admin > s2Member Pro > Stripe Options > Stripe Webhook

I’d also enable logging for the time being, to help gather more info from the transactions to troubleshoot. WP Admin > s2Member > Log Files

I look forward to your update. :slight_smile:

Everything is set up correctly. When I open the webhook URL in my browser, I don’t get any errors (just a blank screen).

I don’t know when this issue started. I don’t remember this being an issue when I first configured Stripe with s2member. But I really didn’t check often…I only recently checked after having some customers have some issues, and that’s when I saw the webhook failures.

I’ve enabled logging to get more info.

In your browser’s Network Monitor, what status code do you get? 200, or other?

I’ve enabled logging to get more info.

Cool, I look forward to what insight it gives.

:slight_smile:

I get a 200 status code in the Network monitor.

I checked some of the Stripe Webhook/IPN log files. I’m seeing the following error with some of the log entries:

0] => Unable to verify Webhook/IPN event ID. This is most likely related to an invalid Stripe configuration. Please check: s2Member → Stripe Options.
[1] => If you’re absolutely SURE that your Stripe configuration is valid, you may want to run some tests on your server, just to be sure $_POST variables (and php://input) are populated; and that your server is able to connect to Stripe over an HTTPS connection.
[2] => s2Member uses the Stripe SDK for remote connections; which relies upon the cURL extension for PHP. Please make sure that your installation of PHP has the cURL extension; and that it’s configured together with OpenSSL for HTTPS communication.

I’m sure the Stripe configuration is valid. The webhook URL and API keys are correct. Not sure how to check the other things it mentions?

Thanks for the additional info. Good work getting it.

You could contact your web host with that, so they confirm if you have it, or tell you how to get it ready.

:slight_smile:

Hello There, hope so you doing well

I am Facing problem to interact with stripe webhook using s2member plugin.

My question is

Where should i place (webhook).php file ?? either in stripe_pro_notify.php OR in Mu Plugin folder, OR anywhere else ??

As i am not using stripe Pro forms offered by s2member, therefore i need to maintain s2member user roles/ levels via Stripe webhook regarding any event occurring on stripe.
Looking forward to hear a solution from you.

Thanks
Malik.

Hi Mlikasif.

I see what you mean.

Well, s2’s endpoint for Stripe is the URL given in your WP Admin > s2Member > Stripe Options > Webhook

s2Member only acts on a few events. I suggest that you study this file: s2member-pro/src/includes/classes/gateways/stripe/stripe-notify-in.inc.php

For now you’d have to modify that file, in the next release I will include a new action hook so you can add your customization from your own file.

:slight_smile:

Thank you so much Clavaque :slightly_smiling_face:

Yes i studied this file, it has a few events.
Can i upgrade or downgrade the User levels on these events ??

Thanks again.

Best,
Malik.

Yes, you can do what you want in your code. You can also add handlers for new events if you need to.

:slight_smile:

Sounds good

New events means, Can i add more events in this file ?? As this file is already written for 6 types of events.