findByCheckoutToken($token); if (!$booking) { wp_die(__('Invalid checkout link.', 'yatra')); } // Prevent 404 handling $this->prevent404(); // Set up global booking object $this->setGlobal('yatra_booking', $booking); // Set up query vars for backward compatibility $this->setQueryVars([ 'yatra_remaining_checkout' => $token, 'yatra_booking' => $booking, ]); // Load the checkout template $template_path = YATRA_PLUGIN_PATH . 'templates/checkout.php'; if (!file_exists($template_path)) { $this->logError("Checkout template not found: {$template_path}"); return false; } include $template_path; $this->exit(); return true; } }