PR Fixes
This commit is contained in:
@@ -20,12 +20,17 @@ export default async function PaymentCallbackPage({
|
||||
searchParams,
|
||||
}: PageArgs<
|
||||
LangParams,
|
||||
{ status: "error" | "success" | "cancel"; confirmationNumber?: string }
|
||||
{
|
||||
status: "error" | "success" | "cancel"
|
||||
confirmationNumber?: string
|
||||
hotel?: string
|
||||
}
|
||||
>) {
|
||||
console.log(`[payment-callback] callback started`)
|
||||
const lang = params.lang
|
||||
const status = searchParams.status
|
||||
const confirmationNumber = searchParams.confirmationNumber
|
||||
const hotelId = searchParams.hotel
|
||||
|
||||
if (status === "success" && confirmationNumber) {
|
||||
const confirmationUrl = `${bookingConfirmation(lang)}?${BOOKING_CONFIRMATION_NUMBER}=${confirmationNumber}`
|
||||
@@ -50,7 +55,7 @@ export default async function PaymentCallbackPage({
|
||||
)
|
||||
trackPaymentEvent({
|
||||
event: "paymentFail",
|
||||
hotelId: searchObject.get("hotel"),
|
||||
hotelId,
|
||||
errorMessage:
|
||||
bookingStatus?.metadata?.errorMessage ??
|
||||
`No error message found for booking ${confirmationNumber}, status: ${status}`,
|
||||
@@ -63,14 +68,14 @@ export default async function PaymentCallbackPage({
|
||||
searchObject.set("errorCode", PaymentErrorCodeEnum.Cancelled.toString())
|
||||
trackPaymentEvent({
|
||||
event: "paymentCancel",
|
||||
hotelId: searchObject.get("hotel"),
|
||||
hotelId,
|
||||
})
|
||||
}
|
||||
if (status === "error") {
|
||||
searchObject.set("errorCode", PaymentErrorCodeEnum.Failed.toString())
|
||||
trackPaymentEvent({
|
||||
event: "paymentFail",
|
||||
hotelId: searchObject.get("hotel"),
|
||||
hotelId,
|
||||
errorMessage: `Failed to get booking status for ${confirmationNumber}, status: ${status}`,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useEffect, useMemo, useRef } from "react"
|
||||
import { useEnterDetailsStore } from "@/stores/enter-details"
|
||||
|
||||
import { useSessionId } from "@/hooks/useSessionId"
|
||||
import { createSDKPageObject } from "@/utils/tracking"
|
||||
import { createSDKPageObject, pushToDataLayer } from "@/utils/tracking"
|
||||
|
||||
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
|
||||
import {
|
||||
@@ -145,7 +145,7 @@ export default function EnterDetailsTracking(props: Props) {
|
||||
}
|
||||
|
||||
//if (previousPathname.current !== pathName) {
|
||||
window.adobeDataLayer.push({
|
||||
pushToDataLayer({
|
||||
event: "pageView",
|
||||
pageInfo: pageObject,
|
||||
userInfo: userTrackingData,
|
||||
|
||||
Reference in New Issue
Block a user