<?php
require_once __DIR__."/config.php";
require_once __DIR__."/middleware/user_auth.php";

$order_id = intval($_GET['order_id'] ?? 0);

if(!$order_id){
    die("INVALID ORDER");
}

// Simulate approval
$conn->query("
    UPDATE fxh_orders 
    SET payment_status='PAID'
    WHERE id='$order_id'
");

echo "
<h2 style='color:#00ff9c'>
✔ SANDBOX PAYMENT APPROVED
</h2>

<p>Your order has been approved.</p>

<a href='/portal/generate_keys.php?order_id=$order_id'>
GENERATE LICENSE KEYS
</a>
";
