hi, sorry for my question but i’m new to snipcart and not so skilled in php. I’ve a php file that validate the order. It is ok if i comment the tocken validation… is there anyone could check if i validate in right way? (or is it necessary to setup something like webhooks for order validation?)
thank’s
…
…
if (!$token) {
echo json_encode([“error” => “Token di autenticazione mancante”]);
exit;
}
// URL di validazione token Snipcart
$snipcart_validation_url = “https://app.snipcart.com/api/requestvalidation/” . urlencode($token);
// Chiamata API per validare il token
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $snipcart_validation_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Se il token non è valido, blocchiamo la richiesta
if ($http_code !== 200) {
echo json_encode([“error” => “Token non valido”]);
exit;
}