diff --git a/api/webhook.php b/api/webhook.php index bc875b6..beb9113 100644 --- a/api/webhook.php +++ b/api/webhook.php @@ -61,7 +61,7 @@ switch ($eventType) { // Payment Intent flow (embedded/direct) - skip if already confirmed by checkout.session.completed $paymentIntentId = $data['id'] ?? ''; $orderId = $data['metadata']['order_id'] ?? ''; - if ($orderId) { + if ($orderId && ($data['status'] ?? '') === 'succeeded') { $order = db()->fetch("SELECT * FROM orders WHERE order_id = :id", ['id' => $orderId]); if ($order && $order['order_status'] !== 'confirmed') { db()->update('orders',