Laravel cannot not connect to Stripe

Viewed 582

I have trouble connecting to Stripe with my Laravel / React application. Locally it works and the same code on a Digital Ocean droplet doesn't. I get this message:

Could not connect to Stripe (https://api.stripe.com/v1/invoices/upcoming?customer=cus_XXXXXXXXXX). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com. (Network error [errno 7]: )

That is the error message from Laravel. The important part is (Network error [errno 7]: ). It has to do with CURL that encounters this error: CURLE_COULDNT_CONNECT (error code 7).

Also I would expect something like this (Network error [errno 7]: Failed connect to api.stripe.com:443; Operation now in progress). Not a blank space after the colon.

I have tried this:

For reference, you can see the error on https://curl.haxx.se/libcurl/c/libcurl-errors.html and means :

CURLE_COULDNT_CONNECT (7) - Failed to connect() to host or proxy.
1 Answers

This is not an issue in the code, you may need to check your server hosting provider.

BTW, you may need to look at This answer. It's the same. It is solved with him by changing the server and when communicating with the host provider, he found that the port is blocked because of high traffic.

Related