Merged in SW-3459-setup-booking-confirmation-page-in-sas (pull request #2794)
Setup booking-confirmation page in SAS * Setup booking-confirmation page in SAS move booking-confirmation tracking to booking-flow * remove unused param * Add test cards to documentation * Fix payment callback page to use correct status Approved-by: Anton Gunnarsson Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
@@ -8,7 +8,6 @@ import { getBookingConfirmation } from "../trpc/memoizedRequests/getBookingConfi
|
||||
import { MEMBERSHIP_FAILED_ERROR } from "../types/membershipFailedError"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import type { BookingConfirmation as BookingConfirmationType } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||
import type { IntlShape } from "react-intl"
|
||||
|
||||
import type { NextSearchParams } from "../types"
|
||||
@@ -17,15 +16,10 @@ export async function BookingConfirmationPage({
|
||||
intl,
|
||||
lang,
|
||||
searchParams,
|
||||
renderTracking,
|
||||
}: {
|
||||
intl: IntlShape
|
||||
lang: Lang
|
||||
searchParams: NextSearchParams
|
||||
renderTracking: (trackingProps: {
|
||||
bookingConfirmation: BookingConfirmationType
|
||||
refId: string
|
||||
}) => React.ReactNode
|
||||
}) {
|
||||
const refId = searchParams.RefId?.toString()
|
||||
|
||||
@@ -56,7 +50,6 @@ export async function BookingConfirmationPage({
|
||||
intl={intl}
|
||||
refId={refId}
|
||||
membershipFailedError={membershipFailedError}
|
||||
renderTracking={renderTracking}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -23,19 +23,20 @@ type PaymentCallbackPageProps = {
|
||||
lang: Lang
|
||||
searchParams: NextSearchParams
|
||||
userAccessToken: string | null
|
||||
status: PaymentCallbackStatusEnum
|
||||
}
|
||||
export async function PaymentCallbackPage({
|
||||
lang,
|
||||
userAccessToken,
|
||||
searchParams,
|
||||
status,
|
||||
}: PaymentCallbackPageProps) {
|
||||
const { status, confirmationNumber } = searchParams
|
||||
const { confirmationNumber } = searchParams
|
||||
|
||||
if (
|
||||
!status ||
|
||||
!confirmationNumber ||
|
||||
typeof confirmationNumber !== "string" ||
|
||||
typeof status !== "string"
|
||||
typeof confirmationNumber !== "string"
|
||||
) {
|
||||
logger.error(
|
||||
`[payment-callback] missing status or confirmationNumber in search params`
|
||||
@@ -143,8 +144,7 @@ export async function PaymentCallbackPage({
|
||||
<HandleErrorCallback
|
||||
returnUrl={returnUrl.toString()}
|
||||
searchObject={searchObject}
|
||||
// TODO we should parse instead of cast
|
||||
status={status as PaymentCallbackStatusEnum}
|
||||
status={status}
|
||||
errorMessage={errorMessage}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user