diff --git a/src/Payments/PaypalSDK.res b/src/Payments/PaypalSDK.res index 6b86fe9a2..8c29274c7 100644 --- a/src/Payments/PaypalSDK.res +++ b/src/Payments/PaypalSDK.res @@ -56,7 +56,7 @@ let make = (~sessionObj: SessionsType.token, ~list: PaymentMethodsRecord.list) = {client: clientInstance}, (paypalCheckoutErr, paypalCheckoutInstance) => { switch paypalCheckoutErr->Nullable.toOption { - | Some(val) => Js.Console.warn(`INTEGRATION ERROR: ${val.message}`) + | Some(val) => Console.warn(`INTEGRATION ERROR: ${val.message}`) | None => () } paypalCheckoutInstance.loadPayPalSDK(. diff --git a/src/Utilities/ErrorUtils.res b/src/Utilities/ErrorUtils.res index 37614daf8..ede0b97ff 100644 --- a/src/Utilities/ErrorUtils.res +++ b/src/Utilities/ErrorUtils.res @@ -137,7 +137,7 @@ let manageErrorWarning = ( ~logCategory=USER_ERROR, (), ) - Js.Console.warn(string) + Console.warn(string) | (Error, Dynamic(fn)) => logger.setLogError( ~value=fn(dynamicStr), @@ -156,7 +156,7 @@ let manageErrorWarning = ( ~logCategory=USER_ERROR, (), ) - Js.Console.warn(fn(dynamicStr)) + Console.warn(fn(dynamicStr)) } } | None => () diff --git a/src/Utilities/PaymentBody.res b/src/Utilities/PaymentBody.res index b634c6da6..5468c8970 100644 --- a/src/Utilities/PaymentBody.res +++ b/src/Utilities/PaymentBody.res @@ -65,7 +65,7 @@ let savedCardBody = (~paymentToken, ~customerId, ~cvcNumber) => [ let customerAcceptanceBody = [ ("acceptance_type", "online"->JSON.Encode.string), - ("accepted_at", Js.Date.now()->Js.Date.fromFloat->Js.Date.toISOString->JSON.Encode.string), + ("accepted_at", Date.now()->Js.Date.fromFloat->Date.toISOString->JSON.Encode.string), ( "online", [("user_agent", BrowserSpec.navigator.userAgent->JSON.Encode.string)] diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res index 78e008e23..7db1cc6f7 100644 --- a/src/Utilities/Utils.res +++ b/src/Utilities/Utils.res @@ -57,10 +57,7 @@ let getInt = (dict, key, default: int) => { ->Belt.Float.toInt } -let getFloatFromString = (str, default) => { - let val = str->Js.Float.fromString - val->Js.Float.isNaN ? default : val -} +let getFloatFromString = (str, default) => str->Float.fromString->Option.getOr(default) let getFloatFromJson = (json, default) => { switch json->JSON.Classify.classify { diff --git a/src/Window.res b/src/Window.res index 5112df1a0..e7454b182 100644 --- a/src/Window.res +++ b/src/Window.res @@ -60,7 +60,7 @@ external style: Dom.element => style = "style" @send external paymentRequest: (JSON.t, JSON.t, JSON.t) => JSON.t = "PaymentRequest" @send external click: Dom.element => unit = "click" -let iframePostMessage = (iframeRef: Js.nullable, message) => { +let iframePostMessage = (iframeRef: nullable, message) => { switch iframeRef->Nullable.toOption { | Some(ref) => try { diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index e30ec4de6..a75ffdc9b 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -14,7 +14,7 @@ let checkAndAppend = (selector, child) => { if ( Window.querySelectorAll(`script[src="${GlobalVars.sentryScriptUrl}"]`)->Array.length === 0 && - Js.typeof(GlobalVars.sentryScriptUrl) !== "undefined" + GlobalVars.sentryScriptUrl->typeof !== #undefined ) { try { let script = Window.createElement("script") diff --git a/src/orca-loader/LoaderPaymentElement.res b/src/orca-loader/LoaderPaymentElement.res index 7235b0d1b..18f9350bd 100644 --- a/src/orca-loader/LoaderPaymentElement.res +++ b/src/orca-loader/LoaderPaymentElement.res @@ -100,7 +100,7 @@ let make = (componentType, options, setIframeRef, iframeRef, mountPostMessage) = switch oElement->Nullable.toOption { | Some(elem) => elem->Window.innerHTML("") | None => - Js.Console.warn( + Console.warn( "INTEGRATION ERROR: Div does not seem to exist on which payment element is to mount/unmount", ) } diff --git a/src/orca-loader/Types.res b/src/orca-loader/Types.res index b0244eb4f..729729884 100644 --- a/src/orca-loader/Types.res +++ b/src/orca-loader/Types.res @@ -17,7 +17,7 @@ type eventHandler = option => unit module This = { type t @get - external iframeElem: t => option> = "iframeElem" + external iframeElem: t => option> = "iframeElem" } type paymentElement = {