From 4bbb062a377b6f0119c48cc19f1620d254d3664f Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Thu, 5 Dec 2024 13:11:15 +0530 Subject: [PATCH] fix: comments addressed --- src/CardTheme.res | 1 + src/Payments/PazeWallet.res | 10 +++++----- src/Payments/SamsungPayComponent.res | 2 +- src/hyper-loader/Elements.res | 18 ++++++++++-------- src/hyper-log-catcher/HyperLogger.res | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/CardTheme.res b/src/CardTheme.res index c5cd8eb1..ebbff5e5 100644 --- a/src/CardTheme.res +++ b/src/CardTheme.res @@ -97,6 +97,7 @@ let getLocaleObject = async string => { | NL => Js.import(DutchLocale.localeStrings) | SV => Js.import(SwedishLocale.localeStrings) | RU => Js.import(RussianLocale.localeStrings) + | ZH_HANT => Js.import(TraditionalChineseLocale.localeStrings) } let awaitedLocaleValue = await promiseLocale diff --git a/src/Payments/PazeWallet.res b/src/Payments/PazeWallet.res index f0f3035c..e96fa21d 100644 --- a/src/Payments/PazeWallet.res +++ b/src/Payments/PazeWallet.res @@ -113,19 +113,19 @@ let make = (~logger: HyperLogger.loggerMake) => { resolve() } } - logger.setLogInfo(~value="Paze SDK Script Loading", ~eventName=PAZE_SDK_FLOW) + logger.setLogInfo(~value="PAZE SDK Script Loading", ~eventName=PAZE_SDK_FLOW) let pazeScript = Window.createElement("script") pazeScript->Window.elementSrc(pazeScriptURL) pazeScript->Window.elementOnerror(exn => { - let err = exn->Identity.anyTypeToJson->JSON.stringify logger.setLogError( - ~value=`Error During Loading Paze SDK Script: ${err}`, + ~value=`Error During Loading PAZE SDK Script: ${exn + ->Identity.anyTypeToJson + ->JSON.stringify}`, ~eventName=PAZE_SDK_FLOW, ) - Console.log2("PAZE --- errrorrr", err) }) pazeScript->Window.elementOnload(_ => { - logger.setLogInfo(~value="Pzae SDK Script Loaded", ~eventName=PAZE_SDK_FLOW) + logger.setLogInfo(~value="PAZE SDK Script Loaded", ~eventName=PAZE_SDK_FLOW) loadPazeSDK()->ignore }) Window.body->Window.appendChild(pazeScript) diff --git a/src/Payments/SamsungPayComponent.res b/src/Payments/SamsungPayComponent.res index 9ea37579..b31fee14 100644 --- a/src/Payments/SamsungPayComponent.res +++ b/src/Payments/SamsungPayComponent.res @@ -30,7 +30,7 @@ let make = (~sessionObj: option, ~walletOptions) => { let onSamsungPaymentButtonClick = _ => { loggerState.setLogInfo( ~value="SamsungPay Button Clicked", - ~eventName=SAMSUNG_PAY_FLOW, + ~eventName=SAMSUNG_PAY, ~paymentMethod="SAMSUNG_PAY", ) SamsungPayHelpers.handleSamsungPayClicked( diff --git a/src/hyper-loader/Elements.res b/src/hyper-loader/Elements.res index 979ca821..911290ff 100644 --- a/src/hyper-loader/Elements.res +++ b/src/hyper-loader/Elements.res @@ -1179,8 +1179,8 @@ let make = ( }) ->catch(err => { logger.setLogError( - ~value=err->formatException->JSON.stringify, - ~eventName=SAMSUNG_PAY_FLOW, + ~value=`SAMSUNG PAY not ready ${err->formatException->JSON.stringify}`, + ~eventName=SAMSUNG_PAY, ~paymentMethod="SAMSUNG_PAY", ~logType=ERROR, ) @@ -1209,8 +1209,10 @@ let make = ( }) ->catch(err => { logger.setLogError( - ~value=err->formatException->JSON.stringify, - ~eventName=SAMSUNG_PAY_FLOW, + ~value=`SAMSUNG PAY Initialization fail ${err + ->formatException + ->JSON.stringify}`, + ~eventName=SAMSUNG_PAY, ~paymentMethod="SAMSUNG_PAY", ~logType=ERROR, ) @@ -1230,8 +1232,8 @@ let make = ( } catch { | err => logger.setLogError( - ~value=err->formatException->JSON.stringify, - ~eventName=SAMSUNG_PAY_FLOW, + ~value=`SAMSUNG PAY Not Ready - ${err->formatException->JSON.stringify}`, + ~eventName=SAMSUNG_PAY, ~paymentMethod="SAMSUNG_PAY", ~logType=ERROR, ) @@ -1239,8 +1241,8 @@ let make = ( } } else if wallets.samsungPay === Never { logger.setLogInfo( - ~value="SamsungPay is set as never by merchant", - ~eventName=SAMSUNG_PAY_FLOW, + ~value="SAMSUNG PAY is set as never by merchant", + ~eventName=SAMSUNG_PAY, ~paymentMethod="SAMSUNG_PAY", ~logType=INFO, ) diff --git a/src/hyper-log-catcher/HyperLogger.res b/src/hyper-log-catcher/HyperLogger.res index afe7fc62..a0f5851f 100644 --- a/src/hyper-log-catcher/HyperLogger.res +++ b/src/hyper-log-catcher/HyperLogger.res @@ -88,7 +88,7 @@ type eventName = | POST_SESSION_TOKENS_CALL_INIT | PAZE_SDK_FLOW | SAMSUNG_PAY_SCRIPT - | SAMSUNG_PAY_FLOW + | SAMSUNG_PAY let eventNameToStrMapper = (eventName: eventName) => (eventName :> string)