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(