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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user