From e4b3f5a1ea4266edad787a71d46c67f2953b17d4 Mon Sep 17 00:00:00 2001 From: Thomas Bartelt Date: Sun, 13 Sep 2026 21:35:26 +0200 Subject: [PATCH] chore(payments): Webhook-Rohmitschnitt nur bei logs/webhook_debug --- payment_webhook.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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);