| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/awebpaca/Dolibarr/htdocs/includes/stripe/tests/ |
Upload File : |
<?php
define("MOCK_MINIMUM_VERSION", "0.5.0");
define("MOCK_PORT", getenv("STRIPE_MOCK_PORT") ?: 12111);
// Send a request to stripe-mock
$ch = curl_init("http://localhost:" . MOCK_PORT . "/");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$resp = curl_exec($ch);
if (curl_errno($ch)) {
echo "Couldn't reach stripe-mock at `localhost:" . MOCK_PORT . "`. Is " .
"it running? Please see README for setup instructions.\n";
exit(1);
}
// Retrieve the Stripe-Mock-Version header
$version = null;
$headers = explode("\n", $resp);
foreach ($headers as $header) {
$pair = explode(":", $header, 2);
if ($pair[0] == "Stripe-Mock-Version") {
$version = trim($pair[1]);
}
}
if ($version === null) {
echo "Could not retrieve Stripe-Mock-Version header. Are you sure " .
"that the server at `localhost:" . MOCK_PORT . "` is a stripe-mock " .
"instance?";
exit(1);
}
if (version_compare($version, MOCK_MINIMUM_VERSION) == -1) {
echo "Your version of stripe-mock (" . $version . ") is too old. The minimum " .
"version to run this test suite is " . MOCK_MINIMUM_VERSION . ". " .
"Please see its repository for upgrade instructions.\n";
exit(1);
}
require_once __DIR__ . '/TestCase.php';