Skip to content

Commit

Permalink
reverting the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
prafulkoppalkar committed Sep 17, 2023
1 parent 76366ab commit df14e7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 28 deletions.
20 changes: 6 additions & 14 deletions src/Payments/GPay.res
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ let default = (props: props) => {
)
}
let processPayment = (body: array<(string, Js.Json.t)>) => {
Js.log("INSIDE Processing payment")
Js.log2("Calling HS /confirm with body", body)
intent(
~bodyArr=body,
~confirmParam={
Expand All @@ -92,23 +90,16 @@ let default = (props: props) => {
~handleUserError=true,
(),
)
Js.log("Called HS /confirm")
}

React.useEffect0(() => {
Js.log("ENTERED EFFECT")
let handle = (ev: Window.event) => {
Js.log("INSIDE Gpay Handle")
let json = ev.data->Js.Json.parseExn
let dict = json->Utils.getDictFromJson
if dict->Js.Dict.get("gpayResponse")->Belt.Option.isSome {
Js.log2("INSIDE Gpay response -dict", dict)
let metadata = dict->getJsonObjectFromDict("gpayResponse")
Js.log2("INSIDE Gpay response -metadata", metadata)
let obj = metadata->getDictFromJson->itemToObjMapper
Js.log2("INSIDE Gpay response -objmapper", obj)
let body = PaymentBody.gpayBody(~payObj=obj, ~connectors)
Js.log2("INSIDE Calling processPayment", body)
processPayment(body)
}
}
Expand Down Expand Up @@ -201,11 +192,12 @@ let default = (props: props) => {
~value=paymentDataRequest->toJson->Js.Json.stringify,
(),
)
options.readOnly ? () : Js.log("INSIDE Iframe Gpay button clicked")
handlePostMessage([
("GpayClicked", true->Js.Json.boolean),
("gpayPaymentRequestData", paymentDataRequest->toJson),
])
options.readOnly
? ()
: handlePostMessage([
("GpayClicked", true->Js.Json.boolean),
("gpayPaymentRequestData", paymentDataRequest->toJson),
])
// paymentsClient.loadPaymentData(. paymentDataRequest)
// ->then(data => {
// loggerState.setLogInfo(
Expand Down
12 changes: 0 additions & 12 deletions src/orca-loader/Elements.res
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,6 @@ let make = (
let gpayPaymentRequestData =
json->OrcaUtils.getOptionalJsonFromJson("gpayPaymentRequestData")
if gpayClicked {
Js.log2(
"OUTSIDE Iframe Gpay Client payload",
{
"environment": publishableKey->Js.String2.startsWith("pk_prd_")
? "PRODUCTION"
: "TEST",
}->toJson,
)
let gPayClient = GooglePayType.google(
{
"environment": publishableKey->Js.String2.startsWith("pk_prd_")
Expand All @@ -362,11 +354,9 @@ let make = (
| Some(json) => json
| None => Js.Dict.empty()->Js.Json.object_
}
Js.log2("OUTSIDE Iframe calling gpay -paylaod", data)
try {
gPayClient.loadPaymentData(. data)
->then(json => {
Js.log2("OUTSIDE Iframe gpay called -response", json)
logger.setLogInfo(
~value=json->toJson->Js.Json.stringify,
~eventName=GOOGLE_PAY_FLOW,
Expand All @@ -379,7 +369,6 @@ let make = (
resolve()
})
->catch(err => {
Js.log2("OUTSIDE Iframe Gpay called -error", err)
logger.setLogInfo(
~value=err->toJson->Js.Json.stringify,
~eventName=GOOGLE_PAY_FLOW,
Expand All @@ -394,7 +383,6 @@ let make = (
->ignore
} catch {
| err => {
Js.log2("OUTSIDE Iframe calling Gpay -error", err->toJson)
logger.setLogInfo(
~value=err->toJson->Js.Json.stringify,
~eventName=GOOGLE_PAY_FLOW,
Expand Down
2 changes: 0 additions & 2 deletions src/orca-loader/LoaderPaymentElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ let make = (componentType, options, setIframeRef, iframeRef, mountPostMessage) =
let handleFullScreenCallback = (ev: Types.event) => {
let json = ev.data->eventToJson
let dict = json->Utils.getDictFromJson
Js.log("iframemounted callback outside")
if dict->Js.Dict.get("iframeMountedCallback")->Belt.Option.isSome {
Js.log("iframemounted callback inside")
let fullScreenEle = Window.querySelector(`#orca-fullscreen`)
fullScreenEle->Window.iframePostMessage(
[
Expand Down

0 comments on commit df14e7a

Please sign in to comment.