Upgrade next@15.5.6 * chore: upgrade next@15.5.6 * chore: upgrade turborepo@2.6.1 * fix typings for scandic-web * fix: set correct type for pages * cleanup * fix more route.ts typing issues * Merge branch 'master' of bitbucket.org:scandic-swap/web into chore/upgrade-next * explicitly import the types Approved-by: Linus Flood
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { notFound } from "next/navigation"
|
|
|
|
import { logger } from "@scandic-hotels/common/logger"
|
|
|
|
import { myStay } from "@/constants/routes/webviews"
|
|
|
|
import GuaranteeCallbackPage from "@/components/GuaranteeCallback"
|
|
|
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
|
import type { PaymentCallbackStatusEnum } from "@scandic-hotels/common/constants/paymentCallbackStatusEnum"
|
|
|
|
export default async function GuaranteePaymentWebViewCallbackPage(
|
|
props: PageProps<"/[lang]/webview/hotelreservation/gla-payment-callback">
|
|
) {
|
|
const searchParams = await props.searchParams
|
|
const params = await props.params
|
|
const lang = params.lang as Lang
|
|
const status = searchParams.status as PaymentCallbackStatusEnum
|
|
const confirmationNumber =
|
|
typeof searchParams.confirmationNumber === "string"
|
|
? searchParams.confirmationNumber
|
|
: undefined
|
|
const refId =
|
|
typeof searchParams.RefId === "string" ? searchParams.RefId : undefined
|
|
|
|
if (!status || !confirmationNumber || !refId) {
|
|
notFound()
|
|
}
|
|
const myStayUrl = `${myStay[lang]}?RefId=${encodeURIComponent(refId)}`
|
|
|
|
logger.debug(`[gla-payment-callback] callback started`)
|
|
return (
|
|
<GuaranteeCallbackPage
|
|
status={status}
|
|
confirmationNumber={confirmationNumber}
|
|
refId={refId}
|
|
myStayUrl={myStayUrl}
|
|
lang={lang}
|
|
isAncillaryFlow={!!searchParams.ancillary}
|
|
/>
|
|
)
|
|
}
|