From 8961cbd9d5b06e439e478bbb6df94094d2f2d195 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Fri, 11 Apr 2025 13:41:19 +0000 Subject: [PATCH] Merged in feat/SW-2322-update-booking-status-polling- (pull request #1778) feat: SW-2322 Added handling of confirmed booking in polling * feat: SW-2322 Added handling of confirmed booking in polling * feat: SW-2322 Removed unnecessary startTransition Approved-by: Michael Zetterberg --- .../EnterDetails/Payment/PaymentClient.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx index 9ca2429b6..8f2cbf565 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx @@ -241,10 +241,16 @@ export default function PaymentClient({ useEffect(() => { if (bookingStatus?.data?.paymentUrl) { router.push(bookingStatus.data.paymentUrl) + } else if ( + bookingStatus?.data?.reservationStatus === + BookingStatusEnum.BookingCompleted + ) { + const confirmationUrl = `${bookingConfirmation(lang)}?${BOOKING_CONFIRMATION_NUMBER}=${bookingStatus?.data?.id}` + router.push(confirmationUrl) } else if (bookingStatus.isTimeout) { handlePaymentError("Timeout") } - }, [bookingStatus, router, intl, handlePaymentError]) + }, [bookingStatus, router, intl, lang, handlePaymentError]) useEffect(() => { setIsSubmittingDisabled(