<?php
require_once __DIR__ . '/includes/config.php';

$userId = 1; // Try with merchant ID 1 or find it
$incomingOrderId = 'fgAQ2HSW3L';
$now = time() - 86400; // yesterday

$cleanIncomingOrderId = str_replace(['_', '-'], '', $incomingOrderId);
$stmt = getDB()->prepare("SELECT * FROM orders WHERE REPLACE(REPLACE(order_id, '_', ''), '-', '') = ?");
$stmt->execute([$cleanIncomingOrderId]);
$order = $stmt->fetch();

var_dump($order);
