Belt.Int.toString}px`}
+ style={height: `${height->Int.toString}px`}
id="google-pay-button"
className={`w-full flex flex-row justify-center rounded-md`}
/>
diff --git a/src/Payments/PayPal.res b/src/Payments/PayPal.res
index 35caa351a..63386baf3 100644
--- a/src/Payments/PayPal.res
+++ b/src/Payments/PayPal.res
@@ -86,7 +86,7 @@ let make = () => {
style={
display: "inline-block",
color: textColor,
- height: `${height->Belt.Int.toString}px`,
+ height: `${height->Int.toString}px`,
borderRadius: "2px",
width: "100%",
backgroundColor: buttonColor,
diff --git a/src/Payments/PaymentRequestButtonElement.res b/src/Payments/PaymentRequestButtonElement.res
index aa8ac6b0a..2814f9901 100644
--- a/src/Payments/PaymentRequestButtonElement.res
+++ b/src/Payments/PaymentRequestButtonElement.res
@@ -65,8 +65,8 @@ let make = (~sessions, ~walletOptions, ~paymentType) => {
{walletOptions
->Array.mapWithIndex((item, i) => {
Belt.Int.toString}-request-button`}>
- } key={i->Belt.Int.toString}>
+ level={ErrorBoundary.RequestButton} key={`${item}-${i->Int.toString}-request-button`}>
+ } key={i->Int.toString}>
{switch clientSecret {
| Some(_) =>
switch item->paymentMode {
diff --git a/src/Payments/PreMountLoader.res b/src/Payments/PreMountLoader.res
index 3b531e00b..c22273856 100644
--- a/src/Payments/PreMountLoader.res
+++ b/src/Payments/PreMountLoader.res
@@ -73,11 +73,11 @@ let make = (~sessionId, ~publishableKey, ~clientSecret, ~endpoint) => {
| _ => JSON.Encode.null
}
let dict = json->Utils.getDictFromJson
- if dict->Dict.get("sendPaymentMethodsResponse")->Belt.Option.isSome {
+ if dict->Dict.get("sendPaymentMethodsResponse")->Option.isSome {
paymentMethodsResponse->sendPromiseData("payment_methods")
- } else if dict->Dict.get("sendCustomerPaymentMethodsResponse")->Belt.Option.isSome {
+ } else if dict->Dict.get("sendCustomerPaymentMethodsResponse")->Option.isSome {
customerPaymentMethodsResponse->sendPromiseData("customer_payment_methods")
- } else if dict->Dict.get("sendSessionTokensResponse")->Belt.Option.isSome {
+ } else if dict->Dict.get("sendSessionTokensResponse")->Option.isSome {
sessionTokensResponse->sendPromiseData("session_tokens")
}
}
diff --git a/src/Payments/QRCodeDisplay.res b/src/Payments/QRCodeDisplay.res
index 50ca3262e..8dd6eb9fc 100644
--- a/src/Payments/QRCodeDisplay.res
+++ b/src/Payments/QRCodeDisplay.res
@@ -44,7 +44,7 @@ let make = () => {
Dict.set(headers, x, val->getStringFromJson(""))
})
let expiryTime =
- metaDataDict->getString("expiryTime", "")->Belt.Float.fromString->Option.getOr(0.0)
+ metaDataDict->getString("expiryTime", "")->Float.fromString->Option.getOr(0.0)
let timeExpiry = expiryTime -. Date.now()
if timeExpiry > 0.0 && timeExpiry < 900000.0 {
setExpiryTime(_ => timeExpiry)
@@ -121,9 +121,8 @@ let make = () => {
}
let expiryString = React.useMemo(() => {
- let minutes = (expiryTime /. 60000.0)->Belt.Float.toInt->Belt.Int.toString
- let seconds =
- mod(expiryTime->Belt.Float.toInt, 60000)->Belt.Int.toString->String.slice(~start=0, ~end=2)
+ let minutes = (expiryTime /. 60000.0)->Float.toInt->Int.toString
+ let seconds = mod(expiryTime->Float.toInt, 60000)->Int.toString->String.slice(~start=0, ~end=2)
let seconds = seconds->String.length == 1 ? `${seconds}0` : seconds
`${minutes}:${seconds}`
}, [expiryTime])
diff --git a/src/Types/PaymentConfirmTypes.res b/src/Types/PaymentConfirmTypes.res
index f16088dbb..67f703cd9 100644
--- a/src/Types/PaymentConfirmTypes.res
+++ b/src/Types/PaymentConfirmTypes.res
@@ -163,7 +163,7 @@ let getNextAction = (dict, str) => {
->Option.flatMap(JSON.Decode.object)
->Option.map(json => json->getVoucherDetails)
},
- next_action_data: Some(json->getDictfromDict("next_action_data")->JSON.Encode.object),
+ next_action_data: Some(json->getDictFromDict("next_action_data")->JSON.Encode.object),
}
})
->Option.getOr(defaultNextAction)
diff --git a/src/Types/PaymentType.res b/src/Types/PaymentType.res
index 4bf8b4ac5..afbf6d5fa 100644
--- a/src/Types/PaymentType.res
+++ b/src/Types/PaymentType.res
@@ -951,7 +951,7 @@ let getConfirmParams = dict => {
let getSdkHandleConfirmPaymentProps = dict => {
handleConfirm: dict->getBool("handleConfirm", false),
buttonText: ?dict->getOptionString("buttonText"),
- confirmParams: dict->getDictfromDict("confirmParams")->getConfirmParams,
+ confirmParams: dict->getDictFromDict("confirmParams")->getConfirmParams,
}
let itemToObjMapper = (dict, logger) => {
@@ -1011,7 +1011,7 @@ let itemToObjMapper = (dict, logger) => {
showCardFormByDefault: getBool(dict, "showCardFormByDefault", true),
billingAddress: getBillingAddress(dict, "billingAddress", logger),
sdkHandleConfirmPayment: dict
- ->getDictfromDict("sdkHandleConfirmPayment")
+ ->getDictFromDict("sdkHandleConfirmPayment")
->getSdkHandleConfirmPaymentProps,
paymentMethodsHeaderText: ?getOptionString(dict, "paymentMethodsHeaderText"),
savedPaymentMethodsHeaderText: ?getOptionString(dict, "savedPaymentMethodsHeaderText"),
diff --git a/src/Types/PaypalSDKTypes.res b/src/Types/PaypalSDKTypes.res
index ce66bbc22..c525de989 100644
--- a/src/Types/PaypalSDKTypes.res
+++ b/src/Types/PaypalSDKTypes.res
@@ -126,11 +126,11 @@ let getShippingDetails = shippingAddressOverrideObj => {
}
let paypalShippingDetails = purchaseUnit => {
- let shippingAddress = purchaseUnit->Utils.getDictfromDict("shipping")
- let payee = purchaseUnit->Utils.getDictfromDict("payee")
+ let shippingAddress = purchaseUnit->Utils.getDictFromDict("shipping")
+ let payee = purchaseUnit->Utils.getDictFromDict("payee")
- let address = shippingAddress->Utils.getDictfromDict("address")
- let name = shippingAddress->Utils.getDictfromDict("name")
+ let address = shippingAddress->Utils.getDictFromDict("address")
+ let name = shippingAddress->Utils.getDictFromDict("name")
let recipientName = name->Utils.getOptionString("full_name")
let line1 = address->Utils.getOptionString("address_line_1")
diff --git a/src/Utilities/ErrorUtils.res b/src/Utilities/ErrorUtils.res
index 86dd2e683..04d64221e 100644
--- a/src/Utilities/ErrorUtils.res
+++ b/src/Utilities/ErrorUtils.res
@@ -173,7 +173,7 @@ let unknownPropValueWarning = (
let valueOutRangeWarning = (num: int, dictType, range, ~logger: OrcaLogger.loggerMake) => {
manageErrorWarning(
VALUE_OUT_OF_RANGE,
- ~dynamicStr=`${num->Belt.Int.toString} value in ${dictType} Expected value between ${range}`,
+ ~dynamicStr=`${num->Int.toString} value in ${dictType} Expected value between ${range}`,
~logger: OrcaLogger.loggerMake,
(),
)
diff --git a/src/Utilities/PaymentHelpers.res b/src/Utilities/PaymentHelpers.res
index 5eb36fd76..26f8f9c89 100644
--- a/src/Utilities/PaymentHelpers.res
+++ b/src/Utilities/PaymentHelpers.res
@@ -609,7 +609,7 @@ let rec intentCall = (
("paymentIntentId", clientSecret->JSON.Encode.string),
("publishableKey", confirmParam.publishableKey->JSON.Encode.string),
("headers", headerObj->JSON.Encode.object),
- ("expiryTime", expiryTime->Belt.Float.toString->JSON.Encode.string),
+ ("expiryTime", expiryTime->Float.toString->JSON.Encode.string),
("url", url.href->JSON.Encode.string),
]->Dict.fromArray
handleLogging(
diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res
index b7714e427..4b075376b 100644
--- a/src/Utilities/Utils.res
+++ b/src/Utilities/Utils.res
@@ -55,8 +55,8 @@ let getInt = (dict, key, default: int) => {
dict
->Dict.get(key)
->Option.flatMap(JSON.Decode.float)
- ->Option.getOr(default->Belt.Int.toFloat)
- ->Belt.Float.toInt
+ ->Option.getOr(default->Int.toFloat)
+ ->Float.toInt
}
let getFloatFromString = (str, default) => str->Float.fromString->Option.getOr(default)
@@ -148,7 +148,7 @@ let getDictFromJson = (json: JSON.t) => {
json->JSON.Decode.object->Option.getOr(Dict.make())
}
-let getDictfromDict = (dict, key) => {
+let getDictFromDict = (dict, key) => {
dict->getJsonObjectFromDict(key)->getDictFromJson
}
@@ -172,7 +172,7 @@ let getNumberWithWarning = (dict, key, ~logger, default) => {
switch dict->Dict.get(key) {
| Some(val) =>
switch val->JSON.Decode.float {
- | Some(val) => val->Belt.Float.toInt
+ | Some(val) => val->Float.toInt
| None =>
manageErrorWarning(TYPE_INT_ERROR, ~dynamicStr=key, ~logger, ())
default
@@ -361,7 +361,7 @@ let rec transformKeys = (json: JSON.t, to: case) => {
}
(key->toCase, val->JSON.Encode.string)
}
- | Number(val) => (key->toCase, val->Belt.Float.toString->JSON.Encode.string)
+ | Number(val) => (key->toCase, val->Float.toString->JSON.Encode.string)
| _ => (key->toCase, value)
}
x
@@ -631,14 +631,14 @@ let addSize = (str: string, value: float, unit: sizeunit) => {
arr
->Array.slice(~start=0, ~end={arr->Array.length - unitInString->String.length})
->Array.joinWith("")
- ->Belt.Float.fromString
+ ->Float.fromString
->Option.getOr(0.0)
- (val +. value)->Belt.Float.toString ++ unitInString
+ (val +. value)->Float.toString ++ unitInString
} else {
str
}
}
-let toInt = val => val->Belt.Int.fromString->Option.getOr(0)
+let toInt = val => val->Int.fromString->Option.getOr(0)
let validateRountingNumber = str => {
if str->String.length != 9 {
diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res
index 4142b429b..2865b6c4e 100644
--- a/src/orca-loader/Elements.res
+++ b/src/orca-loader/Elements.res
@@ -481,19 +481,19 @@ let make = (
let dict = json->getDictFromJson
switch dict->Dict.get("applePayButtonClicked") {
| Some(val) =>
- if val->JSON.Decode.bool->Belt.Option.getWithDefault(false) {
+ if val->JSON.Decode.bool->Option.getOr(false) {
let applePaySessionTokenData =
dict
->Dict.get("applePayPresent")
->Belt.Option.flatMap(JSON.Decode.object)
- ->Belt.Option.getWithDefault(Dict.make())
+ ->Option.getOr(Dict.make())
let isDelayedSessionToken =
applePaySessionTokenData
->Dict.get("delayed_session_token")
- ->Belt.Option.getWithDefault(JSON.Encode.null)
+ ->Option.getOr(JSON.Encode.null)
->JSON.Decode.bool
- ->Belt.Option.getWithDefault(false)
+ ->Option.getOr(false)
if isDelayedSessionToken {
logger.setLogInfo(
@@ -506,9 +506,9 @@ let make = (
let connector =
applePaySessionTokenData
->Dict.get("connector")
- ->Belt.Option.getWithDefault(JSON.Encode.null)
+ ->Option.getOr(JSON.Encode.null)
->JSON.Decode.string
- ->Belt.Option.getWithDefault("")
+ ->Option.getOr("")
switch connector {
| "trustpay" =>
@@ -521,27 +521,27 @@ let make = (
let secrets =
applePaySessionTokenData
->Dict.get("session_token_data")
- ->Belt.Option.getWithDefault(JSON.Encode.null)
+ ->Option.getOr(JSON.Encode.null)
->JSON.Decode.object
- ->Belt.Option.getWithDefault(Dict.make())
+ ->Option.getOr(Dict.make())
->Dict.get("secrets")
- ->Belt.Option.getWithDefault(JSON.Encode.null)
+ ->Option.getOr(JSON.Encode.null)
let paymentRequest =
applePaySessionTokenData
->Dict.get("payment_request_data")
->Belt.Option.flatMap(JSON.Decode.object)
- ->Belt.Option.getWithDefault(Dict.make())
+ ->Option.getOr(Dict.make())
->ApplePayTypes.jsonToPaymentRequestDataType
let payment =
secrets
->JSON.Decode.object
- ->Belt.Option.getWithDefault(Dict.make())
+ ->Option.getOr(Dict.make())
->Dict.get("payment")
- ->Belt.Option.getWithDefault(JSON.Encode.null)
+ ->Option.getOr(JSON.Encode.null)
->JSON.Decode.string
- ->Belt.Option.getWithDefault("")
+ ->Option.getOr("")
try {
let trustpay = trustPayApi(secrets)
@@ -722,7 +722,7 @@ let make = (
let sessionsArr =
json
->JSON.Decode.object
- ->Belt.Option.getWithDefault(Dict.make())
+ ->Option.getOr(Dict.make())
->SessionsType.getSessionsTokenJson("session_token")
let applePayPresent = sessionsArr->Array.find(item => {
@@ -733,10 +733,10 @@ let make = (
x->Dict.get("wallet_name")
})
->Belt.Option.flatMap(JSON.Decode.string)
- ->Belt.Option.getWithDefault("")
+ ->Option.getOr("")
x === "apple_pay" || x === "applepay"
})
- if !(applePayPresent->Belt.Option.isSome) {
+ if !(applePayPresent->Option.isSome) {
let msg =
[("applePaySessionObjNotPresent", true->JSON.Encode.bool)]->Dict.fromArray
mountedIframeRef->Window.iframePostMessage(msg)
@@ -749,7 +749,7 @@ let make = (
x->Dict.get("wallet_name")
})
->Belt.Option.flatMap(JSON.Decode.string)
- ->Belt.Option.getWithDefault("")
+ ->Option.getOr("")
x === "google_pay" || x === "googlepay"
})
@@ -759,7 +759,7 @@ let make = (
let (json, applePayPresent, googlePayPresent) = res
if (
componentType->getIsComponentTypeForPaymentElementCreate &&
- applePayPresent->Belt.Option.isSome
+ applePayPresent->Option.isSome
) {
//do operations here
let processPayment = (
@@ -784,15 +784,15 @@ let make = (
dict->Dict.get("applePayPaymentRequest"),
) {
| (Some(val), Some(paymentRequest)) =>
- if val->JSON.Decode.bool->Belt.Option.getWithDefault(false) {
+ if val->JSON.Decode.bool->Option.getOr(false) {
let isDelayedSessionToken =
applePayPresent
->Belt.Option.flatMap(JSON.Decode.object)
- ->Belt.Option.getWithDefault(Dict.make())
+ ->Option.getOr(Dict.make())
->Dict.get("delayed_session_token")
- ->Belt.Option.getWithDefault(JSON.Encode.null)
+ ->Option.getOr(JSON.Encode.null)
->JSON.Decode.bool
- ->Belt.Option.getWithDefault(false)
+ ->Option.getOr(false)
if !isDelayedSessionToken {
logger.setLogInfo(
~value="Normal Session Token Flow",
@@ -818,9 +818,9 @@ let make = (
let merchantSession =
applePayPresent
->Belt.Option.flatMap(JSON.Decode.object)
- ->Belt.Option.getWithDefault(Dict.make())
+ ->Option.getOr(Dict.make())
->Dict.get("session_token_data")
- ->Belt.Option.getWithDefault(Dict.make()->JSON.Encode.object)
+ ->Option.getOr(Dict.make()->JSON.Encode.object)
->transformKeys(CamelCase)
ssn.completeMerchantValidation(merchantSession)
}
@@ -865,7 +865,7 @@ let make = (
}
if (
componentType->getIsComponentTypeForPaymentElementCreate &&
- googlePayPresent->Belt.Option.isSome &&
+ googlePayPresent->Option.isSome &&
wallets.googlePay === Auto
) {
let dict = json->getDictFromJson
diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res
index 22349cf94..45e741b28 100644
--- a/src/orca-loader/Hyper.res
+++ b/src/orca-loader/Hyper.res
@@ -87,7 +87,7 @@ let make = (publishableKey, options: option, analyticsInfo: optionOption.flatMap(JSON.Decode.object)->Option.getOr(Dict.make())
let sessionID =
analyticsInfoDict->getString("sessionID", "hyp_" ++ Utils.generateRandomString(8))
- let sdkTimestamp = analyticsInfoDict->getString("timeStamp", Date.now()->Belt.Float.toString)
+ let sdkTimestamp = analyticsInfoDict->getString("timeStamp", Date.now()->Float.toString)
let logger = OrcaLogger.make(
~sessionId=sessionID,
~source=Loader,
@@ -151,7 +151,7 @@ let make = (publishableKey, options: option, analyticsInfo: option
- let loaderTimestamp = Date.now()->Belt.Float.toString
+ let loaderTimestamp = Date.now()->Float.toString
{
() => {
diff --git a/src/orca-log-catcher/ErrorBoundary.res b/src/orca-log-catcher/ErrorBoundary.res
index 16c13f715..fb25e90c9 100644
--- a/src/orca-log-catcher/ErrorBoundary.res
+++ b/src/orca-log-catcher/ErrorBoundary.res
@@ -108,7 +108,7 @@ module ErrorCard = {
if enableLogging && ["DEBUG", "INFO", "WARN", "ERROR"]->Array.includes(loggingLevel) {
let errorLog: OrcaLogger.logFile = {
logType: ERROR,
- timestamp: Date.now()->Belt.Float.toString,
+ timestamp: Date.now()->Float.toString,
sessionId: "",
source: "orca-elements",
version: GlobalVars.repoVersion,
diff --git a/src/orca-log-catcher/OrcaLogger.res b/src/orca-log-catcher/OrcaLogger.res
index 1c2852210..aa94918f7 100644
--- a/src/orca-log-catcher/OrcaLogger.res
+++ b/src/orca-log-catcher/OrcaLogger.res
@@ -613,7 +613,7 @@ let make = (~sessionId=?, ~source: source, ~clientSecret=?, ~merchantId=?, ~meta
}
| _ => 0.
}
- latency > 0. ? latency->Belt.Float.toString : ""
+ latency > 0. ? latency->Float.toString : ""
}
let setLogInfo = (
@@ -633,8 +633,8 @@ let make = (~sessionId=?, ~source: source, ~clientSecret=?, ~merchantId=?, ~meta
| Some(lat) => lat->Float.toString
| None => calculateLatencyHook(~eventName, ())
}
- let localTimestamp = timestamp->Option.getOr(Date.now()->Belt.Float.toString)
- let localTimestampFloat = localTimestamp->Belt.Float.fromString->Option.getOr(Date.now())
+ let localTimestamp = timestamp->Option.getOr(Date.now()->Float.toString)
+ let localTimestampFloat = localTimestamp->Float.fromString->Option.getOr(Date.now())
{
logType,
timestamp: localTimestamp,
@@ -684,8 +684,8 @@ let make = (~sessionId=?, ~source: source, ~clientSecret=?, ~merchantId=?, ~meta
let eventNameStr = eventName->eventNameToStrMapper
let firstEvent = events.contents->Dict.get(eventNameStr)->Option.isNone
let latency = calculateLatencyHook(~eventName, ~apiLogType, ())
- let localTimestamp = timestamp->Option.getOr(Date.now()->Belt.Float.toString)
- let localTimestampFloat = localTimestamp->Belt.Float.fromString->Option.getOr(Date.now())
+ let localTimestamp = timestamp->Option.getOr(Date.now()->Float.toString)
+ let localTimestampFloat = localTimestamp->Float.fromString->Option.getOr(Date.now())
{
logType,
timestamp: localTimestamp,
@@ -737,8 +737,8 @@ let make = (~sessionId=?, ~source: source, ~clientSecret=?, ~merchantId=?, ~meta
| Some(lat) => lat->Float.toString
| None => calculateLatencyHook(~eventName, ())
}
- let localTimestamp = timestamp->Option.getOr(Date.now()->Belt.Float.toString)
- let localTimestampFloat = localTimestamp->Belt.Float.fromString->Option.getOr(Date.now())
+ let localTimestamp = timestamp->Option.getOr(Date.now()->Float.toString)
+ let localTimestampFloat = localTimestamp->Float.fromString->Option.getOr(Date.now())
{
logType,
timestamp: localTimestamp,
@@ -775,7 +775,7 @@ let make = (~sessionId=?, ~source: source, ~clientSecret=?, ~merchantId=?, ~meta
{
logType: INFO,
eventName,
- timestamp: Date.now()->Belt.Float.toString,
+ timestamp: Date.now()->Float.toString,
sessionId: sessionId.contents,
source: sourceString,
version: GlobalVars.repoVersion,