prepare( "INSERT INTO food_order_payments (order_id, type, amount, status) VALUES (?,'release',?,?)" )->execute([$orderId, (int)$order['grand_total'], $refunded ? 'success' : 'failed']); if (!$refunded) appLog("[FOOD][ORDER][cancel] refund FAILED for order $orderId — needs manual reconciliation", 'ERROR'); } jsonSuccess(['order_id' => $orderId, 'status' => 'cancelled_by_customer']);