diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx index 536f37b27..21b2f6db3 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx @@ -140,6 +140,7 @@ export default function PaymentClient({ if (result.reservationStatus == BookingStatusEnum.BookingCompleted) { const confirmationUrl = `${bookingConfirmation(lang)}?${BOOKING_CONFIRMATION_NUMBER}=${result.id}` router.push(confirmationUrl) + return } setBookingNumber(result.id) diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/addAncillaryFlowModal.module.css b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/addAncillaryFlowModal.module.css index 7a425f248..c44e24fb6 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/addAncillaryFlowModal.module.css +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/addAncillaryFlowModal.module.css @@ -74,7 +74,7 @@ padding-bottom: var(--Space-x025); } -.divider { +.pointsDivider { display: flex; gap: var(--Space-x2); height: 24px; diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx index cab9f0019..c80c836dc 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx @@ -80,10 +80,13 @@ export default function AddAncillaryFlowModal({ const defaultDeliveryTime = deliveryTimeOptions[0].value + const hasInsufficientPoints = + (user?.membership?.currentPoints ?? 0) < (selectedAncillary?.points ?? 0) + const formMethods = useForm({ defaultValues: { quantityWithPoints: null, - quantityWithCard: user ? null : 1, + quantityWithCard: !user || hasInsufficientPoints ? 1 : null, deliveryTime: defaultDeliveryTime, optionalText: "", termsAndConditions: false, @@ -320,7 +323,7 @@ export default function AddAncillaryFlowModal({

{selectedAncillary.points && ( -
+

diff --git a/apps/scandic-web/hooks/booking/useGuaranteeBooking.ts b/apps/scandic-web/hooks/booking/useGuaranteeBooking.ts index 323407632..a9e46c0f5 100644 --- a/apps/scandic-web/hooks/booking/useGuaranteeBooking.ts +++ b/apps/scandic-web/hooks/booking/useGuaranteeBooking.ts @@ -64,12 +64,19 @@ export function useGuaranteeBooking({ }) useEffect(() => { - if (bookingStatus?.data?.paymentUrl) { + if (bookingStatus?.data?.paymentUrl && isPollingForBookingStatus) { router.push(bookingStatus.data.paymentUrl) + setIsPollingForBookingStatus(false) } else if (bookingStatus.isTimeout) { handlePaymentError() } - }, [bookingStatus, router, handlePaymentError]) + }, [ + bookingStatus, + router, + handlePaymentError, + setIsPollingForBookingStatus, + isPollingForBookingStatus, + ]) const isLoading = guaranteeBooking.isPending || diff --git a/apps/scandic-web/i18n/dictionaries/da.json b/apps/scandic-web/i18n/dictionaries/da.json index 2edf3fa11..63f18347c 100644 --- a/apps/scandic-web/i18n/dictionaries/da.json +++ b/apps/scandic-web/i18n/dictionaries/da.json @@ -911,7 +911,7 @@ "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Din booking er bekræftet, men vi kunne ikke verificere dit medlemskab. Hvis du har booket med et medlemstilbud, skal du enten vise dit eksisterende medlemskab ved check-in, blive medlem eller betale prisdifferencen ved check-in. Tilmelding er foretrukket online før opholdet.", "Your card was successfully removed!": "Dit kort blev fjernet!", "Your card was successfully saved!": "Dit kort blev gemt!", - "Your card will only be used for authorization": "Dit kort vil kun blive brugt til autorisation", + "Your card will only be used for authorisation": "Dit kort vil kun blive brugt til autorisation", "Your current level": "Dit nuværende niveau", "Your details": "Dine oplysninger", "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.", diff --git a/apps/scandic-web/i18n/dictionaries/de.json b/apps/scandic-web/i18n/dictionaries/de.json index 8f72f9ec2..3e75a76e4 100644 --- a/apps/scandic-web/i18n/dictionaries/de.json +++ b/apps/scandic-web/i18n/dictionaries/de.json @@ -909,7 +909,7 @@ "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Ihre Buchung ist bestätigt, aber wir konnten Ihr Mitglied nicht verifizieren. Wenn Sie mit einem Mitgliederrabatt gebucht haben, müssen Sie entweder Ihr vorhandenes Mitgliedschaftsnummer bei der Anreise präsentieren, ein Mitglied werden oder die Preisdifferenz bei der Anreise bezahlen. Die Anmeldung ist vorzugsweise online vor der Aufenthaltsdauer erfolgreich.", "Your card was successfully removed!": "Ihre Karte wurde erfolgreich entfernt!", "Your card was successfully saved!": "Ihre Karte wurde erfolgreich gespeichert!", - "Your card will only be used for authorization": "Ihre Karte wird nur zur Autorisierung verwendet", + "Your card will only be used for authorisation": "Ihre Karte wird nur zur Autorisierung verwendet", "Your current level": "Ihr aktuelles Level", "Your details": "Ihre Angaben", "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.", diff --git a/apps/scandic-web/i18n/dictionaries/en.json b/apps/scandic-web/i18n/dictionaries/en.json index e9f25e02c..d0938d1f6 100644 --- a/apps/scandic-web/i18n/dictionaries/en.json +++ b/apps/scandic-web/i18n/dictionaries/en.json @@ -907,7 +907,7 @@ "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.", "Your card was successfully removed!": "Your card was successfully removed!", "Your card was successfully saved!": "Your card was successfully saved!", - "Your card will only be used for authorization": "Your card will only be used for authorization", + "Your card will only be used for authorisation": "Your card will only be used for authorisation", "Your current level": "Your current level", "Your details": "Your details", "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.", diff --git a/apps/scandic-web/i18n/dictionaries/fi.json b/apps/scandic-web/i18n/dictionaries/fi.json index 10b8566d8..309dc5cb6 100644 --- a/apps/scandic-web/i18n/dictionaries/fi.json +++ b/apps/scandic-web/i18n/dictionaries/fi.json @@ -909,7 +909,7 @@ "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Varauksesi on vahvistettu, mutta jäsenyytesi ei voitu vahvistaa. Jos olet bookeutunut jäsenyysalennoilla, sinun on joko esitettävä olemassa olevan jäsenyysnumero tarkistukseen, tulla jäseneksi tai maksamaan hinnan eron hotellissa. Jäsenyyden tilittäminen on suositeltavampaa tehdä verkkoon ennen majoittumista.", "Your card was successfully removed!": "Korttisi poistettiin onnistuneesti!", "Your card was successfully saved!": "Korttisi tallennettu onnistuneesti!", - "Your card will only be used for authorization": "Korttiasi käytetään vain valtuutukseen", + "Your card will only be used for authorisation": "Korttiasi käytetään vain valtuutukseen", "Your current level": "Nykyinen tasosi", "Your details": "Tietosi", "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.", diff --git a/apps/scandic-web/i18n/dictionaries/no.json b/apps/scandic-web/i18n/dictionaries/no.json index 5b5ab5ccc..7e8c1c0dd 100644 --- a/apps/scandic-web/i18n/dictionaries/no.json +++ b/apps/scandic-web/i18n/dictionaries/no.json @@ -905,7 +905,7 @@ "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Din bestilling er bekreftet, men vi kunne ikke verifisere medlemskapet ditt. Hvis du har booke ut med et medlemsrabatt, må du enten presentere eksisterende medlemsnummer ved check-in, bli medlem eller betale prisdifferansen ved hotellet. Registrering er foretrukket gjort online før oppholdet.", "Your card was successfully removed!": "Kortet ditt ble fjernet!", "Your card was successfully saved!": "Kortet ditt ble lagret!", - "Your card will only be used for authorization": "Kortet ditt vil kun bli brukt til autorisasjon", + "Your card will only be used for authorisation": "Kortet ditt vil kun bli brukt til autorisasjon", "Your current level": "Ditt nåværende nivå", "Your details": "Dine detaljer", "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.", diff --git a/apps/scandic-web/i18n/dictionaries/sv.json b/apps/scandic-web/i18n/dictionaries/sv.json index f509852e7..bda69d630 100644 --- a/apps/scandic-web/i18n/dictionaries/sv.json +++ b/apps/scandic-web/i18n/dictionaries/sv.json @@ -907,7 +907,7 @@ "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Din bokning är bekräftad, men vi kunde inte verifiera ditt medlemskap. Om du har bokat med ett medlemsrabatt måste du antingen presentera ditt befintliga medlemsnummer vid check-in, bli medlem eller betala prisdifferensen vid hotell. Registrering är föredragen gjord online före vistelsen.", "Your card was successfully removed!": "Ditt kort har tagits bort!", "Your card was successfully saved!": "Ditt kort har sparats!", - "Your card will only be used for authorization": "Ditt kort kommer endast att användas för auktorisering", + "Your card will only be used for authorisation": "Ditt kort kommer endast att användas för auktorisering", "Your current level": "Din nuvarande nivå", "Your details": "Dina uppgifter", "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.",