-
-
- {intl.formatMessage({
- id: "enterDetails.confirmBooking.guaranteeLabel",
- defaultMessage:
- "I may arrive later than 18:00 and want to guarantee my booking.",
- })}
-
-
-
-
-
-
-
-
-
-
-
-
+ {!mustBeGuaranteed ? (
+ <>
+
+
+
+
+
+ {intl.formatMessage({
+ id: "enterDetails.guarantee.guaranteeLabel",
+ defaultMessage: "Guarantee for late arrival",
+ })}
+
+
+
+
+ {intl.formatMessage({
+ id: "enterDetails.guarantee.guaranteeInfo",
+ defaultMessage:
+ "I may arrive later than 18:00 and want the hotel to hold my booking.",
+ })}
+
-
-
-
-
-
- {intl.formatMessage({
- id: "booking.smsConfirmationLabel",
- defaultMessage:
- "I would like to get my booking confirmation via sms",
- })}
-
-
-
-
-
-
-
- {intl.formatMessage({
- id: "booking.smsConfirmationLabel",
- defaultMessage:
- "I would like to get my booking confirmation via sms",
- })}
-
-
-
-
+ {intl.formatMessage({
+ id: "enterDetails.payment.mixedRatesInfo",
+ defaultMessage:
+ "As your booking includes rooms with different terms, we will be charging part of the booking now and the remainder will be collected by the reception at check-in.",
+ })}
+
+ {intl.formatMessage({
+ id: "enterDetails.guaranteeInfo.description",
+ defaultMessage:
+ "The hotel will hold your booking, even if you arrive after 18:00. In case of a no-show, your credit card will be charged for the first night.",
+ })}
+
+
+
+
+
+ >
+ )
+}
diff --git a/packages/booking-flow/lib/components/EnterDetails/Payment/PaymentClient.tsx b/packages/booking-flow/lib/components/EnterDetails/Payment/PaymentClient.tsx
index 822b774e5..77cf5a17a 100644
--- a/packages/booking-flow/lib/components/EnterDetails/Payment/PaymentClient.tsx
+++ b/packages/booking-flow/lib/components/EnterDetails/Payment/PaymentClient.tsx
@@ -4,14 +4,10 @@ import { zodResolver } from "@hookform/resolvers/zod"
import { cx } from "class-variance-authority"
import { usePathname, useRouter, useSearchParams } from "next/navigation"
import { useCallback, useEffect, useState } from "react"
-import { Label } from "react-aria-components"
import { FormProvider, useForm } from "react-hook-form"
import { useIntl } from "react-intl"
-import {
- PAYMENT_METHOD_TITLES,
- PaymentMethodEnum,
-} from "@scandic-hotels/common/constants/paymentMethod"
+import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
import {
bookingConfirmation,
selectRate,
@@ -19,11 +15,7 @@ import {
import useStickyPosition from "@scandic-hotels/common/hooks/useStickyPosition"
import { logger } from "@scandic-hotels/common/logger"
import { formatPhoneNumber } from "@scandic-hotels/common/utils/phone"
-import Body from "@scandic-hotels/design-system/Body"
import { Button } from "@scandic-hotels/design-system/Button"
-import Checkbox from "@scandic-hotels/design-system/Form/Checkbox"
-import { PaymentOption } from "@scandic-hotels/design-system/Form/PaymentOption"
-import { PaymentOptionsGroup } from "@scandic-hotels/design-system/Form/PaymentOptionsGroup"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { trackEvent } from "@scandic-hotels/tracking/base"
import {
@@ -37,27 +29,25 @@ import { BookingStatusEnum } from "@scandic-hotels/trpc/enums/bookingStatus"
import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
import { env } from "../../../../env/client"
-import { useAvailablePaymentOptions } from "../../../hooks/useAvailablePaymentOptions"
import { useBookingFlowContext } from "../../../hooks/useBookingFlowContext"
import { clearBookingWidgetState } from "../../../hooks/useBookingWidgetState"
import { useHandleBookingStatus } from "../../../hooks/useHandleBookingStatus"
import { useIsLoggedIn } from "../../../hooks/useIsLoggedIn"
import useLang from "../../../hooks/useLang"
import { useEnterDetailsStore } from "../../../stores/enter-details"
-import ConfirmBooking, { ConfirmBookingRedemption } from "../Confirm"
+import ConfirmBooking from "../Confirm"
import PriceChangeDialog from "../PriceChangeDialog"
import { writeGlaToSessionStorage } from "./PaymentCallback/helpers"
import BookingAlert from "./BookingAlert"
-import GuaranteeDetails from "./GuaranteeDetails"
+import { GuaranteeInfo } from "./GuaranteeInfo"
import {
hasFlexibleRate,
hasPrepaidRate,
isPaymentMethodEnum,
writePaymentInfoToSessionStorage,
} from "./helpers"
-import MixedRatePaymentBreakdown from "./MixedRatePaymentBreakdown"
import { type PaymentFormData, paymentSchema } from "./schema"
-import TermsAndConditions from "./TermsAndConditions"
+import { getPaymentHeadingConfig } from "./utils"
import styles from "./payment.module.css"
@@ -125,8 +115,6 @@ export default function PaymentClient({
const [isPollingForBookingStatus, setIsPollingForBookingStatus] =
useState(false)
- const availablePaymentOptions =
- useAvailablePaymentOptions(otherPaymentOptions)
const [priceChangeData, setPriceChangeData] =
useState(null)
@@ -136,6 +124,7 @@ export default function PaymentClient({
const hasFlexRates = rooms.some(hasFlexibleRate)
const hasOnlyFlexRates = rooms.every(hasFlexibleRate)
const hasMixedRates = hasPrepaidRates && hasFlexRates
+ const isRedemptionBooking = booking.searchType === SEARCH_TYPE_REDEMPTION
const methods = useForm({
defaultValues: {
@@ -527,15 +516,6 @@ export default function PaymentClient({
]
)
- const finalStep = intl.formatMessage({
- id: "enterDetails.payment.onlyFlexRatesTitle",
- defaultMessage: "Final step",
- })
- const selectPayment = intl.formatMessage({
- id: "enterDetails.payment.title",
- defaultMessage: "Select payment method",
- })
-
const handleInvalidSubmit = async () => {
const valid = await methods.trigger()
if (!valid) {
@@ -543,159 +523,62 @@ export default function PaymentClient({
}
}
+ const { preHeading, heading, subHeading, showLearnMore } =
+ getPaymentHeadingConfig(intl, bookingMustBeGuaranteed, hasOnlyFlexRates)
+
return (
-
-
- {hasOnlyFlexRates ? finalStep : selectPayment}
-
-
+
+
+ {preHeading ? (
+
+
{preHeading}
+
+ ) : null}
+
+
{heading}
+
+ {subHeading ? (
+
+
{subHeading}
+
+ ) : null}
+
+ {showLearnMore ? : null}
+
{priceChangeData ? (
diff --git a/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx
index 4ef537f41..a43b7c623 100644
--- a/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx
+++ b/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx
@@ -1,15 +1,14 @@
import { useIntl } from "react-intl"
-import Caption from "@scandic-hotels/design-system/Caption"
import Checkbox from "@scandic-hotels/design-system/Form/Checkbox"
-import Link from "@scandic-hotels/design-system/OldDSLink"
+import { TextLink } from "@scandic-hotels/design-system/TextLink"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useBookingFlowConfig } from "../../../../bookingFlowConfig/bookingFlowConfigContext"
import useLang from "../../../../hooks/useLang"
import { paymentError } from "../schema"
-import styles from "../payment.module.css"
+import styles from "./termsAndConditions.module.css"
type TermsAndConditionsProps = {
isFlexBookingTerms: boolean
@@ -22,81 +21,10 @@ export default function TermsAndConditions({
const { routes } = useBookingFlowConfig()
return (
- <>
-
- {isFlexBookingTerms
- ? intl.formatMessage(
- {
- id: "enterDetails.payment.flexBookingTermsAndConditions",
- defaultMessage:
- "I accept the terms for this booking and the general Booking & Cancellation Terms, and understand that Scandic will process my personal data for this booking in accordance with Scandic's Privacy policy.",
- },
- {
- termsAndConditionsLink: (str) => (
-
- {str}
-
- ),
- privacyPolicyLink: (str) => (
-
- {str}
-
- ),
- }
- )
- : intl.formatMessage(
- {
- id: "enterDetails.payment.termsAndConditions",
- defaultMessage:
- "By paying with any of the payment methods available, I accept the terms for this booking and the general Booking & Cancellation Terms, and understand that Scandic will process my personal data for this booking in accordance with Scandic's Privacy policy. I also accept that Scandic requires a valid payment card during my visit in case anything is left unpaid.",
- },
- {
- termsAndConditionsLink: (str) => (
-
- {str}
-
- ),
- privacyPolicyLink: (str) => (
-
- {str}
-
- ),
- }
- )}
-
+ {isFlexBookingTerms
+ ? intl.formatMessage(
+ {
+ id: "enterDetails.payment.flexBookingTermsAndConditions",
+ defaultMessage:
+ "I accept the terms for this booking and the general Booking & Cancellation Terms, and understand that Scandic will process my personal data for this booking in accordance with Scandic's Privacy policy.",
+ },
+ {
+ termsAndConditionsLink: (str) => (
+
+ {str}
+
+ ),
+ privacyPolicyLink: (str) => (
+
+ {str}
+
+ ),
+ }
+ )
+ : intl.formatMessage(
+ {
+ id: "enterDetails.payment.termsAndConditions",
+ defaultMessage:
+ "By paying with any of the payment methods available, I accept the terms for this booking and the general Booking & Cancellation Terms, and understand that Scandic will process my personal data for this booking in accordance with Scandic's Privacy policy. I also accept that Scandic requires a valid payment card during my visit in case anything is left unpaid.",
+ },
+ {
+ termsAndConditionsLink: (str) => (
+
+ {str}
+
+ ),
+ privacyPolicyLink: (str) => (
+
+ {str}
+
+ ),
+ }
+ )}
+