diff --git a/payment_webhook.php b/payment_webhook.php index b7dfa04..8f47775 100644 --- a/payment_webhook.php +++ b/payment_webhook.php @@ -26,10 +26,12 @@ foreach ($_SERVER as $key => $value) { } } -// Letzte Zustellung roh ablegen (logs/ ist per .htaccess gesperrt) -- fuer die Fehlersuche -// an der Signaturpruefung. Enthaelt keine Zugangsdaten. -@\file_put_contents(__DIR__ . '/logs/webhook_last_' . \preg_replace('/[^a-z0-9_]/', '', $module) . '.json', - \json_encode(['time' => \date('c'), 'headers' => $headers, 'body' => $rawBody], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); +// Letzte Zustellung roh ablegen -- nur wenn logs/webhook_debug existiert (Fehlersuche an +// der Signaturpruefung, 13.09.2026). logs/ ist per .htaccess gesperrt. +if (\is_file(__DIR__ . '/logs/webhook_debug')) { + @\file_put_contents(__DIR__ . '/logs/webhook_last_' . \preg_replace('/[^a-z0-9_]/', '', $module) . '.json', + \json_encode(['time' => \date('c'), 'headers' => $headers, 'body' => $rawBody], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); +} try { $status = $provider->onWebhook($headers, $rawBody);