src/Controller/BookingController.php line 56

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Booking;
  4. use App\Form\BookingFinishType;
  5. use App\Form\PaymentTypeFormType;
  6. use App\Interfaces\BookingsInterface;
  7. use App\Interfaces\HotelMongoInterface;
  8. use App\Interfaces\IHotels;
  9. use App\Interfaces\OrderInterface;
  10. use App\Interfaces\SecurityInterface;
  11. use App\Security\AppCustomAuthenticator;
  12. use App\Vendor\Helper;
  13. use App\Vendor\Symfony\MAbstractController;
  14. use App\Vendor\Symfony\ValidationInterface;
  15. use Doctrine\ORM\EntityManagerInterface;
  16. use Psr\Log\LoggerInterface;
  17. use Psr\Log\LogLevel;
  18. use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
  19. use Symfony\Bundle\SecurityBundle\SecurityBundle;
  20. use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
  21. use Symfony\Component\HttpFoundation\BinaryFileResponse;
  22. use Symfony\Component\HttpFoundation\JsonResponse;
  23. use Symfony\Component\HttpFoundation\Request;
  24. use Symfony\Component\HttpFoundation\ResponseHeaderBag;
  25. use Symfony\Component\HttpKernel\KernelInterface;
  26. use Symfony\Component\Intl\Timezones;
  27. use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
  28. use Symfony\Component\Routing\Annotation\Route;
  29. use Symfony\Component\Security\Core\Security;
  30. use Symfony\Component\Security\Core\User\UserInterface;
  31. use Symfony\Component\Security\Http\Authentication\UserAuthenticatorInterface;
  32. use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
  33. use Symfony\Contracts\Service\ServiceProviderInterface;
  34. use Symfony\Contracts\Translation\TranslatorInterface;
  35. use Twig\Environment;
  36. class BookingController extends MAbstractController
  37. {
  38.     private ValidationInterface $validation;
  39.     public function __construct(ParameterBagInterface $bagKernelInterface $kernelEntityManagerInterface $emValidationInterface $validation)
  40.     {
  41.         parent::__construct($bag$kernel$em);
  42.         $this->validation $validation;
  43.     }
  44.     #[Route("/booking/{_locale}"name"booking"methods: ["GET","POST"])]
  45.     public function booking(Request $requestIHotels $hotelsServiceOrderInterface $orderServiceLoggerInterface $zstLoggerBookingsInterface $bookingsService){
  46.         $session $request->getSession();
  47.         $user $this->getUser();
  48.         if($session->has("all_params")){
  49.             $params $session->get("all_params");
  50.         } else {
  51.             $params $bookingsService->hotelStartData();
  52.         }
  53.         if($session->has("guests_data")){
  54.             $params["guests"] = json_decode($session->get("guests_data"),true);
  55.             $params["bookingStatus"] = OrderInterface::STATUS_STARTED;
  56.             if($session->has("bookingResult")){
  57.                 $orderBookingResponse json_decode($session->get("bookingResult"), true);
  58.             } else {
  59.                 $orderService->setUserId($user->getId());
  60.                 $orderBookingResponse $orderService->orderBooking($params["b_hash"], $params["p_id"], $params["_locale"], $params);
  61.                 $orderService->addRate($orderBookingResponse["bookingResult"]["id"], $params);
  62.                 $orderService->setGuests($orderBookingResponse["bookingResult"]["orderId"],$params);
  63.             }
  64.             if($orderBookingResponse["status"] == 'ok'){
  65.                 return $this->redirectToRoute('booking_form');
  66.             }
  67.             if($orderBookingResponse["status"] == 'error'){
  68.                 $params["error"] = $orderBookingResponse["error"];
  69.             }
  70.         }
  71.         $params $this->asideParams($request$orderService);
  72.         if(empty($this->getUser())){
  73.             $this->session->set('back_url'$this->generateUrl($request->get("_route"), $params));
  74.         }
  75.         return $this->render('booking/booking.html.twig',$params);
  76.     }
  77.     #[Route("/booking/form/{_locale}"name"booking_form"methods: ["GET","POST"])]
  78.     public function bookingForm(Request $request,OrderInterface $orderService,IHotels $hotelsService){
  79.         $session $request->getSession();
  80.         $orderBookingResponse json_decode($session->get("bookingResult"), true);
  81.         if(!empty($orderBookingResponse["paymentTypes"][0]["needCreditCardData"])){
  82.             return $this->redirectToRoute('credit_card_tokenization');
  83.         } else {
  84.             return $this->redirectToRoute('booking_form_finish');
  85.         }
  86.     }
  87.     #[Route("/credit/card/tokenization/{_locale}"name"credit_card_tokenization"methods: ["GET","POST"])]
  88.     public function creditCardTokenizationAjax(Request $request,OrderInterface $orderService,IHotels $hotelsServiceTranslatorInterface $translator,LoggerInterface $bookingLogger){
  89.         $session $request->getSession();
  90.         $params $this->asideParams($request$orderService);
  91.         $params array_merge($params$request->request->all());
  92.         $orderBookingResponse json_decode($session->get("bookingResult"), true);
  93.         $orderService->generateBookingData($params);
  94.         $bookingResponse $orderService->getBookingAssocByOrderId($orderBookingResponse["orderId"]);
  95.         $params["guests"] = json_decode($session->get("guests_data"), true);
  96.         $params["matchHash"] = $bookingResponse["matchHash"];
  97.         $params["mainGuest"] = $params["guests"][0]["adults"][0];
  98.         $params["bookingResult"] = [
  99.             "object_id" => $bookingResponse["object_id"],
  100.             "payUuid" => $bookingResponse["payUuid"],
  101.             "initUuid" => $bookingResponse["initUuid"],
  102.             "paymentTypes" => $bookingResponse["paymentTypes"],
  103.             "partnerId" => $bookingResponse["partnerOrderId"],
  104.         ];
  105.         if(isset($params["checkStatus"]) && !empty($params["checkStatus"]["status"])){
  106.             if($params["checkStatus"]["status"] == 'ok'){
  107.                 $payment_type_form = [];
  108.                 parse_str($params["params"], $payment_type_form);
  109.                 $errorMessage $this->validation->validatePaymentTypeForm($payment_type_form["payment_type_form"]);
  110.                 if(!empty($errorMessage)){
  111.                     $chekInDate = new \DateTime($params["search"]["checkin"]);
  112.                     $params["search"]["checkin"] = $chekInDate->format("Y-m-d");
  113.                     $chekOutDate = new \DateTime($params["search"]["checkout"]);
  114.                     $params["search"]["checkout"] = $chekOutDate->format("Y-m-d");
  115.                     unset($params["params"]);
  116.                     $newParams = [];
  117.                     $newParams["search"] = $params["search"];
  118.                     $hotelDetailUrl $this->generateUrl('app_detail_hotel_detail', ['id'=>$params["search"]["hotelId"], $newParams]);
  119.                     return  new JsonResponse(["status" => false"error" => $errorMessage'detailUrl' => $hotelDetailUrl]);
  120.                 }
  121.                 $bookingLogger->info("CREDITCARDTOKENIZATION request params"$payment_type_form);
  122.                 $res $orderService->creditCardDataTokenization($payment_type_form);
  123.                 $bookingLogger->info("CREDITCARDTOKENIZATION response data"$res);
  124.                 if($res["status"] == "ok"){
  125.                     return new JsonResponse(['status' => true]);
  126.                 }
  127.                 if($res["status"] == "error"){
  128.                     $chekInDate = new \DateTime($params["search"]["checkin"]);
  129.                     $params["search"]["checkin"] = $chekInDate->format("Y-m-d");
  130.                     $chekOutDate = new \DateTime($params["search"]["checkout"]);
  131.                     $params["search"]["checkout"] = $chekOutDate->format("Y-m-d");
  132.                     unset($params["params"]);
  133.                     $newParams = [];
  134.                     $newParams["search"] = $params["search"];
  135.                     $hotelDetailUrl $this->generateUrl('app_detail_hotel_detail', ['id'=>$params["search"]["hotelId"], $newParams]);
  136.                     return  new JsonResponse(["status" => false"error" => $translator->trans($res["error"]), 'detailUrl' => $hotelDetailUrl]);
  137.                 }
  138.             }
  139.             if($params["checkStatus"]["status"] == 'no'){
  140.                 $newParams = [];
  141.                 $newParams["search"] = $params["search"];
  142.                 $hotelDetailUrl $this->generateUrl('app_detail_hotel_detail', ['id'=>$params["search"]["hotelId"], $newParams]);
  143.                 return  new JsonResponse(["status" => false"error" => $translator->trans($res["error"]), 'detailUrl' => $hotelDetailUrl]);
  144.             }
  145.         }
  146.         $paymentForm $this->createForm(PaymentTypeFormType::class);
  147.         $paymentForm->handleRequest($request);
  148.         $params["paymentForm"] = $paymentForm->createView();
  149.         $params["status"] = "card";
  150.         if(empty($this->getUser())){
  151.             $this->session->set('back_url'$this->generateUrl($request->get("_route"), $params));
  152.         }
  153.         return $this->render('booking/booking.html.twig',$params);
  154.     }
  155.     #[Route("/booking/form/finish/{_locale}"name"booking_form_finish"methods: ["GET","POST"])]
  156.     public function bookingFormFinish(Request $request,OrderInterface $orderService,IHotels $hotelsServiceBookingsInterface $bookingsServiceLoggerInterface $zstLoggerLoggerInterface $bookingLoggerTranslatorInterface $translator){
  157.         $session $request->getSession();
  158.         $sessionParams $session->get("all_params");
  159.         $params $this->getParams();
  160.         $params array_merge($params$sessionParams);
  161.         $params["guests"] = json_decode($session->get("guests_data"), true);
  162.         $bookingResponse json_decode($session->get('bookingResult'),true);
  163. //        if(!empty($params["guests"])){
  164. //            $params["guests"] = $orderService->convertBookingGuests($params["guests"]);
  165. //        }
  166.         $params["orderId"] = $bookingResponse["orderId"];
  167.         $params["matchHash"] = $bookingResponse["matchHash"];
  168.         $session->set("all_params"$params);
  169.         $params $this->asideParams($request$orderService);
  170.         $bookingFinishForm $this->createForm(BookingFinishType::class);
  171.         $bookingFinishForm->handleRequest($request);
  172.         if(isset($params["checkStatus"]) && !empty($params["checkStatus"]["status"])){
  173.             if($params["checkStatus"]["status"] == 'ok'){
  174.                 $bookingFinishParams $orderService->generateBookingFinishData($params["orderId"], $params["search"]["language"], $params);
  175.                 $bookingLogger->info("BOOKINGFORMFINISH request params"$bookingFinishParams);
  176.                 $res $orderService->orderBookingFinish($bookingFinishParams);
  177.                 $bookingLogger->info("BOOKINGFORMFINISH response data"$res);
  178.                 if($res["status"] == 'ok' || $res["status"] == "error" && $res["error"] == 'unknown' || $res["status"] == "error" && $res["error"] == 'timeout'){
  179.                     $startDate date('Y-m-d H:i:s');
  180.                     $k true;
  181.                     while ($k){
  182.                         $endDate date('Y-m-d H:i:s');
  183.                         $diff strtotime($endDate) - strtotime($startDate);
  184.                         $l abs(round($diff));
  185.                         $result $this->getFinishStatus($bookingResponse["partnerOrderId"], $bookingsService,$orderService);
  186.                         $bookingLogger->info("ORDER BOOKING FINISH STATUS response data"$result);
  187.                         if($result["status"] == 'error'){
  188.                             $k false;
  189.                             $newParams = [];
  190.                             $newParams["search"] = $params["search"];
  191.                             $hotelDetailUrl $this->generateUrl('app_detail_hotel_detail', ['id'=>$params["search"]["hotelId"],$newParams]);
  192.                             return  new JsonResponse(["status" => 'error'"error" => $translator->trans($res["error"]), 'detailUrl' => $hotelDetailUrl]);
  193.                         }
  194.                         if($result["status"] == 'ok'){
  195.                             $voucherUrl "https://api.worldota.net/api/b2b/v3/hotel/order/document/voucher/download/";
  196.                             $urlStr '{"partner_order_id":"'.$bookingResponse["partnerOrderId"].'","language":"'.$params["search"]["language"].'"}';
  197.                             $url $voucherUrl.'?data='.urlencode($urlStr);
  198.                             $pdfData $orderService->worldotaAuth($url,$params["orderId"]);
  199.                             $bookingsService->setVoucher((int)$params["orderId"], $pdfData);
  200.                             $bookingsService->setBookingStatus($params["orderId"], OrderInterface::STATUS_COMPLETED);
  201.                             $bookingsUrl $this->generateUrl('app_profile_my_bookings');
  202.                             return new JsonResponse(['status' => 'ok''bookingsUrl' => $bookingsUrl]);
  203.                         }
  204.                         if($result["status"] == 'processing'){
  205.                             $k true;
  206.                         }
  207.                         if($result["status"] == '3ds'){
  208.                             $bookingLogger->info("3DS STATUS REQUEST"$result);
  209.                             $dsRes =  $this->postData3ds($result["data"]);
  210.                             $bookingLogger->info("3DS STATUS RESPONSE"$dsRes);
  211.                         }
  212.                         if(intval($l) >= 600){
  213.                             $k false;
  214.                         }
  215.                         usleep(5000000);
  216.                     }
  217.                 } else {
  218.                     $newParams = [];
  219.                     $newParams["search"] = $params["search"];
  220.                     $hotelDetailUrl $this->generateUrl('app_detail_hotel_detail', ['id'=>$params["search"]["hotelId"],$newParams]);
  221.                     return  new JsonResponse(["status" => 'error'"error" => $translator->trans($res["error"]), 'detailUrl' => $hotelDetailUrl]);
  222.                 }
  223.             }
  224.             if($params["checkStatus"]["status"] == 'no'){
  225.                 $newParams = [];
  226.                 $newParams["search"] = $params["search"];
  227.                 $hotelDetailUrl $this->generateUrl('app_detail_hotel_detail', ['id'=>$params["search"]["hotelId"],$newParams]);
  228.                 return  new JsonResponse(["status" => false"error" => $translator->trans('rate_not_found'), 'detailUrl' => $hotelDetailUrl]);
  229.             }
  230.         }
  231.         $bookingFinishForm $this->createForm(BookingFinishType::class);
  232.         $bookingFinishForm->handleRequest($request);
  233.         $params["bookingFinishForm"] = $bookingFinishForm->createView();
  234.         $params["status"] = "finish";
  235.         $rate =  json_decode($session->get('rate'),true);
  236.         $params["payment_types"] = $rate["payment_options"]["payment_types"];
  237.         if(empty($this->getUser())){
  238.             $this->session->set('back_url'$this->generateUrl($request->get("_route"), $params));
  239.         }
  240.         return $this->render('booking/booking.html.twig',$params);
  241.     }
  242.     #[Route("/booking/form/finish/status"name"booking_form_finish_status")]
  243.     public function bookingFinishStatus(Request $requestOrderInterface $orderServiceLoggerInterface $zstLoggerIHotels $hotelService){
  244.         $params $this->getParams();
  245.         return new JsonResponse($params);
  246.     }
  247.     #[Route("/booking/form/finish/status/ajax"name"booking_form_finish_status_ajax"methods: ["POST"])]
  248.     public function bookingFormFinishStatus(Request $requestOrderInterface $orderServiceBookingsInterface $bookingsServiceEnvironment $twigLoggerInterface $zstLogger){
  249.         $partnerId $request->get("partnerId");
  250.         /** @var Booking $booking */
  251.         $booking $bookingsService->getBookingByPartnerId($partnerId);
  252.         $orderId $booking->getOrderId();
  253.         $res $orderService->checkBookingFinishStatus($partnerId);
  254.         if($res["status"] == 'ok'){
  255.             $bookingsService->setBookingStatus($orderIdOrderInterface::STATUS_COMPLETED);
  256.             $zstLogger->log(LogLevel::INFO"BookingFormFinishStatus:".json_encode($res));
  257.             $bookingsUrl $this->generateUrl('app_profile_my_bookings');
  258.             return new JsonResponse(['status' => 'ok''bookingsUrl' => $bookingsUrl]);
  259.         } else {
  260.             $bookingsService->setBookingStatus($orderIdOrderInterface::STATUS_ERROR);
  261.             $zstLogger->log(LogLevel::ERROR"BookingFormFinishStatus:".json_encode($res));
  262.             return new JsonResponse(['status' => 'no']);
  263.         }
  264.     }
  265.     #[Route("/booking/form/add/gusts"name"booking_form_add_guests_ajax"methods: ["POST","GET"])]
  266.     public function bookingFormAddGuests(Request $requestOrderInterface $orderServiceEnvironment $twig,SecurityInterface $security,UserPasswordHasherInterface $userPasswordHasherUserAuthenticatorInterface $userAuthenticatorAppCustomAuthenticator $authenticator){
  267.         $session $request->getSession();
  268.         $response["success"] = false;
  269.         $params $this->getParams();
  270.         $mainGuest $params["room"][0]["adults"][0];
  271.         $email $mainGuest['email'];
  272.         $loggedInUser $this->getUser();
  273.         $user $security->getUserByEmail($email);
  274.         if(!empty($loggedInUser)){
  275.             if ($loggedInUser->getEmail() != $email){
  276.                 if(empty($user)){
  277.                     $request->request->set('first_name'$mainGuest["first_name"]);
  278.                     $request->request->set('last_name'$mainGuest["last_name"]);
  279.                     $request->request->set('mobile'$mainGuest["mobile"]);
  280.                     $request->request->set('email'$mainGuest["email"]);
  281.                     $security->register($userPasswordHasher,$userAuthenticator,$authenticatorfalse);
  282.                 }
  283.             }
  284.         } else {
  285.             if(empty($user)){
  286.                 $request->request->set('first_name'$mainGuest["first_name"]);
  287.                 $request->request->set('last_name'$mainGuest["last_name"]);
  288.                 $request->request->set('mobile'$mainGuest["mobile"]);
  289.                 $request->request->set('email'$mainGuest["email"]);
  290.                 $security->register($userPasswordHasher,$userAuthenticator,$authenticatortrue);
  291.             } else {
  292.                 $security->login($email,$userAuthenticator,$authenticator);
  293.             }
  294.         }
  295.         try {
  296.             $session->set("guests_data"json_encode($params["room"]));
  297.             $response["success"] = true;
  298.             $guests $params["room"];
  299.             $html $twig->render('pages/booking_guests.html.twig',[
  300.                 "guests" => $guests
  301.             ]);
  302.             $response["html"] = $html;
  303.         } catch (\Exception $e){
  304.             $response["error"] = $e->getMessage();
  305.         }
  306.         return new JsonResponse($response);
  307.     }
  308.     #[Route("/booking/download/voucher"name"booking_download_voucher")]
  309.     public function downloadVoucher(Request $request){
  310.         $voucherPath $request->get('voucherPath');
  311.         $voucher $request->get('voucher');
  312.         $response = new BinaryFileResponse($voucherPath);
  313.         $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT,$voucher);
  314.         return $response;
  315.     }
  316.     #[Route("/booking/rate/check"name"booking_rate_check"methods: ["POST","GET"])]
  317.     public function checkHotel(Request $request){
  318.         $session $request->getSession();
  319.         $sessionParams $session->get("all_params");
  320.         $res["status"] = false;
  321.         $params $this->getParams();
  322.         $params array_merge($params$sessionParams);
  323. //        foreach ($params['search']["guests"] as &$guest){
  324. //            $guest["adults"] = (int)$guest["adults"];
  325. //            if(!empty($guest["children"])){
  326. //                foreach ($guest["children"] as &$child){
  327. //                    $child = (int)$child;
  328. //                }
  329. //            }
  330. //        }
  331.         $guests = [];
  332.         foreach ($params['search']["guests"] as $room){
  333.             $item["adults"] = (int)$room["adults"];
  334.             if(empty($room["children"])){
  335.                 $item["children"] = [];
  336.             } else{
  337.                 foreach ($room["children"] as $child){
  338.                     $item["children"][] = (int)$child;
  339.                 }
  340.             }
  341.             $guests[] = $item;
  342.         }
  343.         try{
  344.             $checkin $params['search']["checkin"];
  345.             $checkout $params['search']["checkout"];
  346.             $matchHash $params["matchHash"];
  347.             $hotelSearch = [
  348.                 'checkin' =>   $checkin,
  349.                 'checkout' => $checkout,
  350.                 'language' => $params['search']["language"],
  351.                 'guests' => $guests,
  352.                 'currency' => $params['search']["currency"],
  353.                 'id' => trim($params['search']["hotelId"])
  354.             ];
  355.             $jsonParams json_encode($hotelSearch);
  356.             $curl curl_init();
  357.             curl_setopt_array($curl, array(
  358.                 CURLOPT_URL => 'https://api.worldota.net/api/b2b/v3/search/hp/',
  359.                 CURLOPT_USERPWD => $this->bag->get('zstd_user').":".$this->bag->get('zstd_pass'),
  360.                 CURLOPT_RETURNTRANSFER => true,
  361.                 CURLOPT_ENCODING => '',
  362.                 CURLOPT_MAXREDIRS => 10,
  363.                 CURLOPT_TIMEOUT => 0,
  364.                 CURLOPT_FOLLOWLOCATION => true,
  365.                 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  366.                 CURLOPT_CUSTOMREQUEST => 'POST',
  367.                 CURLOPT_POSTFIELDS => $jsonParams,
  368.                 CURLOPT_HTTPHEADER => array(
  369.                     'Content-Type: application/json'
  370.                 ),
  371.             ));
  372.             $response curl_exec($curl);
  373.             curl_close($curl);
  374.             $hotelResponseData json_decode($responsetrue);
  375.             if($hotelResponseData["status"] == 'ok'){
  376.                 $rates $hotelResponseData['data']['hotels'][0]['rates'];
  377.                 foreach ($rates as $rate){
  378.                     if($rate['match_hash'] == $matchHash){
  379.                         $res['data']["status"] = 'ok';
  380.                         break;
  381.                     } else {
  382.                         $res['data']["status"] = 'no';
  383.                     }
  384.                 }
  385.             } else {
  386.                 $res['data'] = $hotelResponseData;
  387.             }
  388.             $res["status"] = true;
  389.         } catch (\Exception $e){
  390.             $res["error"] = $e->getMessage();
  391.         }
  392.         return new JsonResponse($res);
  393.     }
  394.     #[Route("/booking-cancel"name"booking_cancel")]
  395.     public function cancelBooking(Request $requestOrderInterface $orderServiceBookingsInterface $bookingsService){
  396.         $partnerId $request->get('partnerId');
  397.         $orderId $request->get('orderId');
  398.         $status 2;
  399.         $res $orderService->cancelBooking($partnerId);
  400.         if(!empty($res["error"])){
  401.             $status 1;
  402.         } else {
  403.             $bookingsService->setBookingStatus($orderIdOrderInterface::STATUS_CANCELED);
  404.         }
  405.         return $this->redirectToRoute('app_profile_my_bookings', ['status' => $status'result' => $res]);
  406.     }
  407.     private function asideParams(Request $request,$orderService){
  408.         $session $request->getSession();
  409.         $params $session->get("all_params");
  410.         $rate =  json_decode($session->get('rate'),true);
  411.         $params["taxes"] = $orderService->getTaxesData();
  412.         $params["cancelMessages"] = $orderService->generateCancelationPenalties();
  413.         $params["payment_types"] = $rate["payment_options"]["payment_types"];
  414.         return $params;
  415.     }
  416.     private function getAuthenticator(?string $authenticatorNamestring $firewallName): AuthenticatorInterface
  417.     {
  418.         if (!isset($this->authenticators[$firewallName])) {
  419.             throw new \LogicException(sprintf('No authenticators found for firewall "%s".'$firewallName));
  420.         }
  421.         /** @var ServiceProviderInterface $firewallAuthenticatorLocator */
  422.         $firewallAuthenticatorLocator $this->authenticators[$firewallName];
  423.         if (!$authenticatorName) {
  424.             $authenticatorIds array_keys($firewallAuthenticatorLocator->getProvidedServices());
  425.             if (!$authenticatorIds) {
  426.                 throw new \LogicException(sprintf('No authenticator was found for the firewall "%s".'$firewallName));
  427.             }
  428.             if (\count($authenticatorIds)) {
  429.                 throw new \LogicException(sprintf('Too many authenticators were found for the current firewall "%s". You must provide an instance of "%s" to login programmatically. The available authenticators for the firewall "%s" are "%s".'$firewallNameAuthenticatorInterface::class, $firewallNameimplode('" ,"'$authenticatorIds)));
  430.             }
  431.             return $firewallAuthenticatorLocator->get($authenticatorIds[0]);
  432.         }
  433.         if ($firewallAuthenticatorLocator->has($authenticatorName)) {
  434.             return $firewallAuthenticatorLocator->get($authenticatorName);
  435.         }
  436.         $authenticatorId 'security.authenticator.'.$authenticatorName.'.'.$firewallName;
  437.         if (!$firewallAuthenticatorLocator->has($authenticatorId)) {
  438.             throw new \LogicException(sprintf('Unable to find an authenticator named "%s" for the firewall "%s". Available authenticators: "%s".'$authenticatorName$firewallNameimplode('", "'array_keys($firewallAuthenticatorLocator->getProvidedServices()))));
  439.         }
  440.         return $firewallAuthenticatorLocator->get($authenticatorId);
  441.     }
  442.     private function getFinishStatus($partnerId$bookingsService,$orderService){
  443.         return $orderService->checkBookingFinishStatus($partnerId);
  444.     }
  445.     private function postData3ds($params3ds){
  446.         $data json_decode($params3dstrue);
  447.         $getData $data["data"]["data_3ds"];
  448.         $action_url $getData["action_url"];
  449.         $postData = [
  450.             "md" => $getData["data"]["MD"],
  451.             "PaReq" => $getData["data"]["PaReq"],
  452.             "TermUrl" => $getData["data"]["TermUrl"]
  453.         ];
  454.         $jsonData json_encode($postData);
  455.         $curl curl_init();
  456.         curl_setopt_array($curl, array(
  457.             CURLOPT_URL => $action_url,
  458.             CURLOPT_RETURNTRANSFER => true,
  459.             CURLOPT_ENCODING => '',
  460.             CURLOPT_MAXREDIRS => 10,
  461.             CURLOPT_TIMEOUT => 0,
  462.             CURLOPT_FOLLOWLOCATION => true,
  463.             CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  464.             CURLOPT_CUSTOMREQUEST => 'POST',
  465.             CURLOPT_POSTFIELDS =>$jsonData,
  466.             CURLOPT_HTTPHEADER => array(
  467.                 'Content-Type: application/json'
  468.             ),
  469.         ));
  470.         $response curl_exec($curl);
  471.         curl_close($curl);
  472.         return json_decode($responsetrue);
  473.     }
  474. }