feat(payments/mollie): Next-Gen-Webhooks (JSON, HMAC-SHA256 X-Mollie-Signature) neben klassischem id=tr_; fix: Bestellbestaetigung aus Webhook-/CLI-Kontext (Layout-Objekt im Bootstrap); markCancelled idempotent

This commit is contained in:
Thomas Bartelt
2026-09-27 21:51:11 +02:00
parent b8111a1e7f
commit 5f3bbc2c45
3 changed files with 94 additions and 8 deletions
+19
View File
@@ -30,3 +30,22 @@ require_once __DIR__ . '/Registry.php';
$base_object = new base();
Registry::set('base', $base_object);
// 27.09.2026 -- Layout-Objekt (Smarty) auch hier: die Bestellbestaetigung rendert die
// Positionen ueber DeliveryItemsHTML, das Registry::get('layout_object') holt. Ohne das
// scheiterte die Mail, wenn der WEBHOOK (nicht die Rueckkehr) die Zahlung abschloss
// ("Call to a member function assign() on null", Mollie-Test 290616). Der Kunde
// bekam dann keine Bestaetigung. start() braucht SERVER_NAME (CLI: aus MAIN_URL).
if (empty($_SERVER['SERVER_NAME']) && \defined('MAIN_URL')) {
$_SERVER['SERVER_NAME'] = (string) \parse_url((string) MAIN_URL, PHP_URL_HOST);
}
$_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI'] ?? '/'; // layout.class.php liest sie beim Start
try {
require_once $docroot . '/libs/smarty/libs/Smarty.class.php';
require_once $docroot . '/core/layout.class.php';
$layout_object = new layout();
$layout_object->start($base_object);
Registry::set('layout_object', $layout_object);
} catch (\Throwable $e) {
\error_log('payments bootstrap: Layout nicht initialisiert -- ' . $e->getMessage());
}