Merged in fix/STAY-67-redirect-to-webview-after-gla (pull request #2795)
fix(STAY-67): redirect to webview after guarantee on my stay * fix(STAY-67): redirect to webview after guarantee on my stay * fix(STAY-67): add callback page for guarantee on webview Approved-by: Linus Flood
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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 { PaymentCallbackStatusEnum } from "@scandic-hotels/common/constants/paymentCallbackStatusEnum"
|
||||
|
||||
import type { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function GuaranteePaymentWebViewCallbackPage(
|
||||
props: PageArgs<
|
||||
LangParams,
|
||||
{
|
||||
status?: PaymentCallbackStatusEnum
|
||||
RefId?: string
|
||||
confirmationNumber?: string
|
||||
ancillary?: string
|
||||
}
|
||||
>
|
||||
) {
|
||||
const searchParams = await props.searchParams
|
||||
const params = await props.params
|
||||
logger.debug(`[gla-payment-callback] callback started`)
|
||||
const lang = params.lang
|
||||
const status = searchParams.status
|
||||
const confirmationNumber = searchParams.confirmationNumber
|
||||
const refId = searchParams.RefId
|
||||
if (!status || !confirmationNumber || !refId) {
|
||||
notFound()
|
||||
}
|
||||
const myStayUrl = `${myStay[lang]}?RefId=${encodeURIComponent(refId)}`
|
||||
|
||||
return (
|
||||
<GuaranteeCallbackPage
|
||||
status={status}
|
||||
confirmationNumber={confirmationNumber}
|
||||
refId={refId}
|
||||
myStayUrl={myStayUrl}
|
||||
lang={lang}
|
||||
isAncillaryFlow={!!searchParams.ancillary}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user