42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import type { IntlShape } from "react-intl"
|
|
|
|
export function getPaymentHeadingConfig(
|
|
intl: IntlShape,
|
|
bookingMustBeGuaranteed: boolean,
|
|
hasOnlyFlexRates: boolean
|
|
) {
|
|
if (hasOnlyFlexRates) {
|
|
return bookingMustBeGuaranteed
|
|
? {
|
|
heading: intl.formatMessage({
|
|
id: "enterDetails.payment.guaranteePaymentHeading",
|
|
defaultMessage: "Guarantee with card",
|
|
}),
|
|
subHeading: intl.formatMessage({
|
|
id: "enterDetails.payment.guaranteePaymentSubheading",
|
|
defaultMessage: "(your card won't be charged now)",
|
|
}),
|
|
showLearnMore: true,
|
|
}
|
|
: {
|
|
heading: intl.formatMessage({
|
|
id: "enterDetails.payment.onlyFlexRatesTitle",
|
|
defaultMessage: "Final step",
|
|
}),
|
|
showLearnMore: false,
|
|
}
|
|
}
|
|
|
|
return {
|
|
preHeading: intl.formatMessage({
|
|
id: "enterDetails.payment.label",
|
|
defaultMessage: "Payment",
|
|
}),
|
|
heading: intl.formatMessage({
|
|
id: "enterDetails.payment.title",
|
|
defaultMessage: "Select payment method",
|
|
}),
|
|
showLearnMore: false,
|
|
}
|
|
}
|