<?php
require_once(__DIR__ . '/../config/db_config.php');
require_once __DIR__ . '/../models/Order.php';

if (!isset($_GET['order_id'])) {
    http_response_code(400);
    echo 'Missing order_id';
    exit;
}
$order_id = $_GET['order_id'];
$order = new Order();
if ($order->getOrderByOrderCode($order_id)) {
    $order->updateStatus('expired');
    echo 'OK';
} else {
    http_response_code(404);
    echo 'Order not found';
} 