PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.7
Yatra – Travel Booking & Tour Operator Software v3.0.2.7
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / app / Core / Handlers / CheckoutPageHandler.php

CheckoutPageHandler.php in Yatra – Travel Booking & Tour Operator Software 3.0.2.7, at app/Core/Handlers/CheckoutPageHandler.php

60 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Yatra\Core\Handlers;
6
7 use Yatra\Repositories\BookingRepository;
8
9 /**
10 * Checkout Page Handler
11 *
12 * Handles remaining checkout page requests
13 */
14 class CheckoutPageHandler extends BasePageHandler
15 {
16 /**
17 * Handle checkout page request
18 *
19 * @param array $route_data Route data from RouteMatcher
20 * @return bool True if handled successfully
21 */
22 public function handle(array $route_data): bool
23 {
24 $token = $route_data['token'];
25
26 // Validate checkout token
27 $bookingRepo = new BookingRepository();
28 $booking = $bookingRepo->findByCheckoutToken($token);
29
30 if (!$booking) {
31 wp_die(__('Invalid checkout link.', 'yatra'));
32 }
33
34 // Prevent 404 handling
35 $this->prevent404();
36
37 // Set up global booking object
38 $this->setGlobal('yatra_booking', $booking);
39
40 // Set up query vars for backward compatibility
41 $this->setQueryVars([
42 'yatra_remaining_checkout' => $token,
43 'yatra_booking' => $booking,
44 ]);
45
46 // Load the checkout template
47 $template_path = YATRA_PLUGIN_PATH . 'templates/checkout.php';
48
49 if (!file_exists($template_path)) {
50 $this->logError("Checkout template not found: {$template_path}");
51 return false;
52 }
53
54 include $template_path;
55 $this->exit();
56
57 return true;
58 }
59 }
60