Skip to content

Commit

Permalink
fix: threeDsMethod logs change
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrishab Srivatsa committed Apr 17, 2024
1 parent 1ac46bf commit 4a3f2be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 30 deletions.
2 changes: 0 additions & 2 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ let make = (

let nicknameFieldClassName = conditionsForShowingSaveCardCheckbox ? "pt-2" : "pt-5"

Js.log2("sdvjnsddsjd", (list.mandate_payment, options.terms.card))

<div className="animate-slowShow">
<RenderIf condition={showFields || isBancontact}>
<div
Expand Down
28 changes: 6 additions & 22 deletions src/ThreeDSMethod.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let make = () => {
LoggerUtils.handleLogging(
~optLogger=Some(logger),
~eventName=THREE_DS_METHOD_RESULT,
~value="Successful Form Submission",
~value="Y",
~paymentMethod="CARD",
(),
)
Expand Down Expand Up @@ -59,14 +59,13 @@ let make = () => {

let iframeId = metaDataDict->getString("iframeId", "")

let handleFailureScenarios = (eventName, value, internalMetadata, logType) => {
let handleFailureScenarios = value => {
LoggerUtils.handleLogging(
~optLogger=Some(logger),
~eventName,
~eventName=THREE_DS_METHOD_RESULT,
~value,
~internalMetadata,
~paymentMethod="CARD",
~logType,
~logType=ERROR,
(),
)
metadata->Utils.getDictFromJson->Dict.set("3dsMethodComp", "N"->JSON.Encode.string)
Expand All @@ -89,31 +88,16 @@ let make = () => {
input.value = encodeURIComponent(threeDsMethodStr)
form.target = "threeDsInvisibleIframe"
form.appendChild(input)

LoggerUtils.handleLogging(
~optLogger=Some(logger),
~eventName=THREE_DS_METHOD,
~value="Submitting Form",
~paymentMethod="CARD",
(),
)

try {
form.submit()
} catch {
| err => {
let exceptionMessage = err->Utils.formatException->JSON.stringify
handleFailureScenarios(
THREE_DS_METHOD_RESULT,
"Form Submission Failed",
exceptionMessage,
ERROR,
)
handleFailureScenarios(exceptionMessage)
}
}
}
| None =>
handleFailureScenarios(THREE_DS_METHOD, "Unable to Locate threeDsInvisibleDiv", "", INFO)
| None => handleFailureScenarios("Unable to Locate threeDsInvisibleDiv")
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/orca-log-catcher/OrcaLogger.res
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ type eventName =
| RETRIEVE_CALL
| AUTHENTICATION_CALL_INIT
| AUTHENTICATION_CALL
| THREE_DS_METHOD_CALL_INIT
| THREE_DS_METHOD_CALL
| CONFIRM_CALL_INIT
| CONFIRM_CALL
| SESSIONS_CALL_INIT
Expand Down Expand Up @@ -79,8 +77,6 @@ let eventNameToStrMapper = eventName => {
| RETRIEVE_CALL => "RETRIEVE_CALL"
| AUTHENTICATION_CALL_INIT => "AUTHENTICATION_CALL_INIT"
| AUTHENTICATION_CALL => "AUTHENTICATION_CALL"
| THREE_DS_METHOD_CALL_INIT => "THREE_DS_METHOD_CALL_INIT"
| THREE_DS_METHOD_CALL => "THREE_DS_METHOD_CALL"
| CONFIRM_CALL_INIT => "CONFIRM_CALL_INIT"
| CONFIRM_CALL => "CONFIRM_CALL"
| SESSIONS_CALL_INIT => "SESSIONS_CALL_INIT"
Expand Down Expand Up @@ -499,7 +495,7 @@ let make = (
PAYMENT_ATTEMPT,
CONFIRM_CALL,
AUTHENTICATION_CALL,
THREE_DS_METHOD_CALL,
THREE_DS_METHOD_RESULT,
SDK_CRASH,
REDIRECTING_USER,
DISPLAY_BANK_TRANSFER_INFO_PAGE,
Expand All @@ -508,6 +504,7 @@ let make = (
LOADER_CHANGED,
SESSIONS_CALL,
RETRIEVE_CALL,
DISPLAY_THREE_DS_SDK,
]
arrayOfLogs
->Array.find(log => {
Expand Down Expand Up @@ -542,7 +539,6 @@ let make = (
}
}
| AUTHENTICATION_CALL
| THREE_DS_METHOD_CALL
| RETRIEVE_CALL
| CONFIRM_CALL
| SESSIONS_CALL
Expand Down

0 comments on commit 4a3f2be

Please sign in to comment.