Merged in feat/SW-2643-aa-tracking-phone-number-email- (pull request #2617)
feat: SW-2643 Tracking added mobile and email hash in booking cofirmation * feat: SW-2643 Tracking added mobile and email hash in booking cofirmation Approved-by: Matilda Landström
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { createHash } from "crypto"
|
||||||
import { differenceInCalendarDays, format, isWeekend } from "date-fns"
|
import { differenceInCalendarDays, format, isWeekend } from "date-fns"
|
||||||
|
|
||||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||||
@@ -169,6 +170,8 @@ export function getTracking(
|
|||||||
: "no"
|
: "no"
|
||||||
: "na",
|
: "na",
|
||||||
guaranteedProduct: isGuaranteedFlexBooking ? "room" : "na",
|
guaranteedProduct: isGuaranteedFlexBooking ? "room" : "na",
|
||||||
|
emailId: getSHAHash(booking.guest.email),
|
||||||
|
mobileNumber: getSHAHash(booking.guest.phoneNumber),
|
||||||
}
|
}
|
||||||
|
|
||||||
const paymentInfo: TrackingSDKPaymentInfo = {
|
const paymentInfo: TrackingSDKPaymentInfo = {
|
||||||
@@ -208,3 +211,7 @@ function constructRateCodeName(room: Room) {
|
|||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(" - ")
|
.join(" - ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSHAHash(key: string) {
|
||||||
|
return createHash("sha256").update(key).digest("hex")
|
||||||
|
}
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ export type TrackingSDKHotelInfo = {
|
|||||||
totalPrice?: number | string
|
totalPrice?: number | string
|
||||||
lateArrivalGuarantee?: string
|
lateArrivalGuarantee?: string
|
||||||
guaranteedProduct?: string
|
guaranteedProduct?: string
|
||||||
|
emailId?: string // Encrypted hash value on booking confirmation page
|
||||||
|
mobileNumber?: string // Encrypted hash value on booking confirmation page
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Ancillary = {
|
export type Ancillary = {
|
||||||
|
|||||||
Reference in New Issue
Block a user