$id]); $ch2 = curl_init($markUrl); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch2, CURLOPT_POST, true); curl_setopt($ch2, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch2, CURLOPT_CAINFO, $cacertPath); curl_setopt($ch2, CURLOPT_TIMEOUT, 10); $markResponse = curl_exec($ch2); if (curl_errno($ch2)) { echo "❌ Gagal tandai printed: " . curl_error($ch2) . "\n"; curl_close($ch2); sleep(3); continue; } $markHttpCode = curl_getinfo($ch2, CURLINFO_HTTP_CODE); curl_close($ch2); echo "📨 Response mark: $markResponse (HTTP $markHttpCode)\n"; if ($markHttpCode === 200 && strpos($markResponse, 'updated') !== false) { echo "✅ Struk ID $id ditandai sebagai printed.\n"; unlink($filename); } else { echo "❌ Gagal tandai printed, response: $markResponse (HTTP $markHttpCode)\n"; } sleep(3); }