Skip to content

Commit

Permalink
fix: comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed May 8, 2024
1 parent a8485bf commit 87983aa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
15 changes: 11 additions & 4 deletions src/LoaderController.res
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,17 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime
dict->getJsonObjectFromDict("isReadyToPay")->JSON.Decode.bool->Option.getOr(false)
)
}
if dict->getDictIsSome("endpoint") {
switch dict->getString("endpoint", "") {
| "" => ()
| endpoint => ApiEndpoint.setApiEndPoint(endpoint)
if (
dict->getDictIsSome("customBackendUrlVal") &&
dict
->getString("customBackendUrlVal", "")
->String.length > 0
) {
if dict->getDictIsSome("endpoint") {
switch dict->getString("endpoint", "") {
| "" => ()
| endpoint => ApiEndpoint.setApiEndPoint(endpoint)
}
}
}
if dict->getDictIsSome("paymentMethodList") {
Expand Down
7 changes: 4 additions & 3 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@ let make = (
</div>
</div>
<RenderIf
condition={cardError->String.length > 0 ||
cvcError->String.length > 0 ||
expiryError->String.length > 0}>
condition={innerLayout === Compressed &&
(cardError->String.length > 0 ||
cvcError->String.length > 0 ||
expiryError->String.length > 0)}>
<div
className="Error pt-1"
style={ReactDOMStyle.make(
Expand Down
3 changes: 2 additions & 1 deletion src/orca-loader/Elements.res
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ let make = (
~publishableKey,
~logger: option<OrcaLogger.loggerMake>,
~analyticsMetadata,
~customBackendUrl,
) => {
let applePaySessionRef = ref(Nullable.null)

try {
let iframeRef = []
let logger = logger->Option.getOr(OrcaLogger.defaultLoggerConfig)
Expand Down Expand Up @@ -297,6 +297,7 @@ let make = (
("parentURL", "*"->JSON.Encode.string),
("analyticsMetadata", analyticsMetadata),
("launchTime", launchTime->JSON.Encode.float),
("customBackendUrlVal", customBackendUrl->JSON.Encode.string),
]->Dict.fromArray

let wallets = PaymentType.getWallets(newOptions->getDictFromJson, "wallets", logger)
Expand Down
4 changes: 4 additions & 0 deletions src/orca-loader/Hyper.res
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ let make = (publishableKey, options: option<JSON.t>, analyticsInfo: option<JSON.
~clientSecret={clientSecretId},
~logger=Some(logger),
~analyticsMetadata,
~customBackendUrl=options
->Option.getOr(JSON.Encode.null)
->getDictFromJson
->getString("customBackendUrl", ""),
)
}
let confirmCardPaymentFn = (
Expand Down

0 comments on commit 87983aa

Please sign in to comment.