There was a problem connecting to the Stripe API endpoint

[ad_1]

Hi there @georgiedavies

Most commonly, the There was a problem connecting to the stripe API endpoint error occurs due to cURL requests not working. Those requests sometimes stop working due to the following reasons at a hosting level:

  • The server is not running a recent version of PHP and the cURL library.
  • The Server Memory Limits are not high enough
  • Could be an issue with DNS. Your hosting company might need to switch DNS configuration to OpenDNS.
  • There could be some limitation with wp-cron, or if loopback is disabled.
  • Firewall or security modules (e.g., mod_security ) that could block the outgoing cURL requests.
  • It could sometimes be a conflict of plugins on the site.

Generally speaking, those are all possible causes. It’s not an exact science, but it does look like an issue you would want to resolve with help from your hosting provider.

[0] => cURL error 28: Failed to connect to api.stripe.com port 443 after 8751 ms: Couldn’t connect to server

There are a few things that can cause this error, but typically, it’s due to an issue on the server end. This document goes over some options:

https://www.samuelaguilera.com/post/curl-error-28-wordpress

To help you further, I’d like to understand more about your setup.

Could you please send me a copy of your site’s System Status? You can find it via WooCommerce > Status. Select Get system report and then Copy for support.

Once you’ve done that, you can paste the text in and feel free to change/remove your site URL in the report for privacy reasons.

You can paste the Gist link here in your reply, once you have that.

Let us know if you have any other questions!

Thanks for this reply. So is it worth sending my hosts a message?

I’m just not sure what changed yesterday when everything has been perfect up until now?

The Gist link is

Hi,

You can temporarily switch your theme to Storefront, and disable all plugins except WooCommerce and Stripe Payment Gateway. Then please recheck your Stripe API Keys under WooCommerce > settings > payments > Stripe > settings > Account details.

You can use the Meks Quick Plugin Disabler to remember what plugins you currently have active so it’s easy to switch them back on.

If the cURL error is still present at this point, please reach out to your host, they can help you to check if the PHP settings, firewall settings, or other server settings are properly set.

Let us know how this goes.

Thanks for your reply Igor. Will give this a go. When you say check the API Keys what do you mean though as 50% of the times I’ve tried to save them or check connection since this issue started yesterday they have saved ok and connection has been made. If they are working 50% of the time (often within minutes of each other) is this a plugin or theme conflict?

Hi,

I was referring to the Stripe API Keys, they are necessary to permit the connection between WooCommerce and Stripe. It is important to recheck them in this case:

If the keys look OK, I’d suggest reaching out to your host, they can confirm if there is an API Key issue, or if there is something blocking the connection.

Let us know how that goes for you.

The API Keys currently in Woocommerce and my Stripe account both match. Is that what you mean? I had already checked that

The error appears to be with connection between the Woocommerce Stripe Plugin and Stripe itself?

Do you still suggest the plugin conflict check?

Howdy @georgiedavies

Do you still suggest the plugin conflict check?

Yes, please.

For more detailed instructions, check out How to test for plugin and theme conflicts.

Also, under “Advanced settings”, tick Log error messages if you wish to save logs that can help you/us troubleshoot your site. This can be disabled and enabled as needed.

  1. Logs will appear under WooCommerce > Status > Logs. Use the dropdown menu to select, and view.
  • The log will be format as follows:
    woocommerce-gateway-stripe-[date]-[string].log
  • When enabled, only events that happen after the point of being enabled are logged.
  • Kindly share here any logs, output from the plugin, also.

    Looking forward to hearing from you!

A quick follow-up.

Kindly navigate to WooCommerce > Settings > Payments > Stripe > Settings, and click on the “Edit Account Keys” button, under General.

In that new pop-up window, there will be a “Test connection” button, in the bottom left.

What is the result of testing the connection with it?

Hi Pepe

Thanks for the message. As stated above I have tested the connection approximately 8 times today and 3 out of 8 have had successful connection and the other 5 not. Same with the saving of the API keys. This is why I’m not sure I can perform a plugin conflict as testing the connection in this account keys doesn’t give a consistent result currently before starting so how would I know if something had changed?

I have put the logs from since this issue was reported on the Dashboard below:

2023-01-25T09:43:09+00:00 DEBUG

2023-01-26T12:12:19+00:00 DEBUG

I have also looked at the logs and webhooks on Stripe’s own website and the two failed orders on the second log there were recorded as “chargeable” and had a HTTP status code of 200 but then a new payment wasn’t created like usual. That’s when the order failed

Hi,

Thanks for sending the info.

It is possible that something at the server level on the site is failing to communicate with Stripe’s servers. The next step is to reach out to your host. You can provide them the error logs as well.

More info for your reference: How to fix a “cURL error 28

Please let us know how that goes.

Thank you, will do that and come back to you

I think my hosts have solved the problem. There was a firewall issue with Stripe’s IP addresses. Will be keeping an eye in case that wasn’t the only issue but for now I think this is solved

Hey there @georgiedavies ,

Thank you so much for adding your input! Some of our customers might indeed find this insight helpful!

We appreciate you being an active part of the community 🙂</img>

I’ll go ahead with marking this thread as resolved now. Feel free to open a new one, should anything else requires it.

Have a wonderful day!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer