Last active
March 28, 2018 18:13
-
-
Save mrw/9ad010203cac0f99529540442565e6b0 to your computer and use it in GitHub Desktop.
Stripe PHP test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
File prepared by Matt Weinberg, www.vectormediagroup.com | |
EXPLANATION: | |
In 2018, Stripe will be updating their Live/Production environment TLS settings. | |
Many servers, especially older ones, will not be able to connect to Stripe after the settings are changed. | |
You can test your server by running the script below. | |
INSTRUCTIONS: | |
Place this file in your website root and go to it in a browser. The output will tell you if you should expect | |
to have a problem or not. | |
If you will have a problem, the output will provide resources for fixing it. | |
PLEASE NOTE THAT NO UPDATE TO CARTTHROB OR OTHER CART SOFTWARE CAN FIX SERVERS WITH ERRORS. YOUR SERVER MUST UPDATE | |
ITS PHP CURL SETTINGS TO BE COMPATIBLE. | |
More information from Stripe can be found here: | |
https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2 | |
*/ | |
$host = "https://api-tls12.stripe.com"; | |
$ch = curl_init($host); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$connect = curl_exec($ch); | |
if (!$connect) { | |
echo "FAILURE: Your site will not be able to connect to Stripe soon. Please contact your host and tell them to \"update PHP's cURL so it can successfully connect to {$host}\"." . PHP_EOL . PHP_EOL . "They can find more information here: https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2. " . PHP_EOL . PHP_EOL . "The exact error is:" . PHP_EOL; | |
print_r(curl_error($ch)); | |
} else { | |
echo "SUCCESS: You should be able to connect to Stripe."; | |
} | |
curl_close($ch); | |
exit(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment