Merged in fix/SW-3020-paymentInfo-tracking (pull request #2403)

fix(SW-3020): add correct paymentInfo in booking flow and ancillary flow

* fix(SW-3020): add correct paymentInfo in booking flow and ancillary flow

* fix(SW-3020): fix pr comments


Approved-by: Tobias Johansson
This commit is contained in:
Bianca Widstam
2025-06-24 13:38:30 +00:00
parent eb77241a4e
commit 5c3b30ea93
10 changed files with 136 additions and 23 deletions

View File

@@ -80,7 +80,13 @@ export default function Form() {
cardType: savedCreditCard.cardType,
}
: undefined
writeGlaToSessionStorage("yes", hotelId)
const lateArrivalGuarantee = "yes"
writeGlaToSessionStorage(
lateArrivalGuarantee,
hotelId,
savedCreditCard ? savedCreditCard.type : PaymentMethodEnum.card,
!!savedCreditCard
)
guaranteeBooking.mutate({
refId,
language: lang,

View File

@@ -57,16 +57,18 @@ export default function TrackGuarantee({
}
const trackGuaranteePaymentEvent = (event: string, status: string) => {
const glaHotelInfo = readGlaFromSessionStorage()
const glaSessionData = readGlaFromSessionStorage()
trackEvent({
event,
hotelInfo: {
hotelId: glaHotelInfo?.hotelId,
hotelId: glaSessionData?.hotelId,
lateArrivalGuarantee: "yes",
guaranteedProduct: "room",
},
paymentInfo: {
status,
type: glaSessionData?.paymentMethod,
isSavedCreditCard: glaSessionData?.isSavedCreditCard,
...(errorMessage && { errorMessage }),
},
})
@@ -75,14 +77,19 @@ export default function TrackGuarantee({
switch (status) {
case PaymentCallbackStatusEnum.Success:
const glaHotelInfo = readGlaFromSessionStorage()
const glaSessionData = readGlaFromSessionStorage()
trackEvent({
event: "guaranteeBookingSuccess",
hotelInfo: {
hotelId: glaHotelInfo?.hotelId,
hotelId: glaSessionData?.hotelId,
lateArrivalGuarantee: "yes",
guaranteedProduct: "room",
},
paymentInfo: {
type: glaSessionData?.paymentMethod,
hotelId: glaSessionData?.hotelId,
isSavedCreditCard: glaSessionData?.isSavedCreditCard,
},
})
clearGlaSessionStorage()
break