Implementiere Shopify-Webhook-Eingang

This commit is contained in:
2026-08-12 16:22:44 +02:00
parent f2c9150cb3
commit 4af5742b41
2 changed files with 184 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../../../modules/shared/db.php';
require_once __DIR__ . '/../../../modules/erp/import-integration/shopify-webhook.php';
$env = expand_env_values(parse_env_file(__DIR__ . '/../../../.env'));
try {
$pdo = connect_database($env);
$rawPayload = file_get_contents('php://input');
if ($rawPayload === false || $rawPayload === '') {
json_response(400, ['status' => 'rejected', 'error' => 'empty_body']);
}
$result = handle_shopify_webhook($pdo, $env, $rawPayload, $_SERVER);
json_response($result['http_status'], $result['payload']);
} catch (Throwable) {
json_response(500, ['status' => 'failed', 'error' => 'technical_error']);
}