$currency = sanitize($_GET['currency'] ?? 'BTC'); $amount_crypto = calc_crypto_amount($plan_price, $currency); if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['create_order'])) { $currency = sanitize($_POST['currency'] ?? 'BTC'); $amount_crypto = calc_crypto_amount($plan_price, $currency); $expires = date('Y-m-d H:i:s', time() + (PAYMENT_TIMEOUT * 60)); $wallet = get_wallet($currency); $stmt = $db->prepare("INSERT INTO orders (user_id, plan_id, amount, currency, payment_address, wallet_address, payment_status, expires_at, created_at) VALUES (?, ?, ?, ?, ?, ?, 'pending', ?, datetime('now'))"); if ($stmt->execute([$user_id, $plan['id'], $amount_crypto, $currency, $wallet, $wallet, $expires])) { $order_id = $db->lastInsertId(); header('Location: /subscribe?order=' . $order_id); exit; } $error = __('error_payment'); } // View existing order $order_ref = intval($_GET['order'] ?? 0); if ($order_ref) { $stmt = $db->prepare("SELECT * FROM orders WHERE id = ? AND user_id = ?"); $stmt->execute([$order_ref, $user_id]); $order_data = $stmt->fetch(PDO::FETCH_ASSOC); if (!$order_data) { header('Location: /my-account'); exit; } $time_remaining = strtotime($order_data['expires_at']) - time(); $plan_name = $plan['name']; $currency = $order_data['currency']; $amount_crypto = $order_data['amount']; $wallet = $order_data['wallet_address']; } include __DIR__ . '/includes/header.php'; ?>

:

Order #

:

≈ $ USD

0): ?>

0): ?> You have minutes to complete payment. If payment is not received within the time limit, the order expires. Payments received after expiry will NOT be refunded automatically - contact support for assistance. Please send the EXACT amount shown above to the wallet address provided.

: — $