Skip to content

Commit

Permalink
fix: HS-154: Log redirects in case of confirm error, remove extra logs (
Browse files Browse the repository at this point in the history
  • Loading branch information
vsrivatsa-edinburgh authored Nov 6, 2023
1 parent b084b4e commit 2f57f01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/Utilities/LoggerUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ let handleLogging = (
~internalMetadata="",
~eventName,
~paymentMethod,
~logType: OrcaLogger.logType=INFO,
(),
) => {
switch optLogger {
| Some(logger) => logger.setLogInfo(~value, ~internalMetadata, ~eventName, ~paymentMethod, ())
| Some(logger) =>
logger.setLogInfo(~value, ~internalMetadata, ~eventName, ~paymentMethod, ~logType, ())
| _ => ()
}
}
9 changes: 9 additions & 0 deletions src/Utilities/PaymentHelpers.res
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ let intentCall = (
~message="Payment failed. Try again!",
)
if uri->Js.String2.includes("force_sync=true") {
handleLogging(
~optLogger,
~value=intent.nextAction.type_,
~internalMetadata=intent.nextAction.type_,
~eventName=REDIRECTING_USER,
~paymentMethod,
~logType=ERROR,
(),
)
openUrl(url.href)
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/orca-loader/Elements.res
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,6 @@ let make = (
("applePaySyncPayment", true->Js.Json.boolean),
]->Js.Dict.fromArray
mountedIframeRef->Window.iframePostMessage(msg)
logger.setLogInfo(
~value="",
~eventName=PAYMENT_DATA_FILLED,
~paymentMethod="APPLE_PAY",
(),
)
resolve()
})
->catch(err => {
Expand Down

0 comments on commit 2f57f01

Please sign in to comment.