diff --git a/src/screens/PayoutRouting/PayoutRoutingConfigure.res b/src/screens/PayoutRouting/PayoutRoutingConfigure.res index cdb0e386c..f4c6fae28 100644 --- a/src/screens/PayoutRouting/PayoutRoutingConfigure.res +++ b/src/screens/PayoutRouting/PayoutRoutingConfigure.res @@ -57,7 +57,7 @@ let make = (~routingType) => { baseUrlForRedirection /> | DEFAULTFALLBACK => - + | _ => React.null }} diff --git a/src/screens/Routing/DefaultRouting.res b/src/screens/Routing/DefaultRouting.res index 00f52d4fa..a9938211d 100644 --- a/src/screens/Routing/DefaultRouting.res +++ b/src/screens/Routing/DefaultRouting.res @@ -2,11 +2,7 @@ open APIUtils open MerchantAccountUtils @react.component -let make = ( - ~urlEntityName, - ~baseUrlForRedirection, - ~connectorList: array, -) => { +let make = (~urlEntityName, ~baseUrlForRedirection) => { open LogicUtils let getURL = useGetURL() let updateDetails = useUpdateMethod() @@ -19,6 +15,7 @@ let make = ( let (gateways, setGateways) = React.useState(() => []) let (defaultRoutingResponse, setDefaultRoutingResponse) = React.useState(_ => []) let modalObj = RoutingUtils.getModalObj(DEFAULTFALLBACK, "default") + let typedConnectorValue = HyperswitchAtom.connectorListAtom->Recoil.useRecoilValueFromAtom let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let settingUpConnectorsState = routingRespArray => { @@ -27,7 +24,7 @@ let make = ( value->getDictFromJsonObject->getString("profile_id", "") === profile ) - let connectors = switch profileList->Array.get(0) { + let connectorList = switch profileList->Array.get(0) { | Some(json) => json ->getDictFromJsonObject @@ -35,15 +32,8 @@ let make = ( | _ => routingRespArray } - let gatewayConnectors = connectors->Array.filter(connectorsItem => { - connectorList->Array.some(connectorListItem => { - connectorListItem.merchant_connector_id === - connectorsItem->getDictFromJsonObject->getString("merchant_connector_id", "") - }) - }) - - if gatewayConnectors->Array.length > 0 { - setGateways(_ => gatewayConnectors) + if connectorList->Array.length > 0 { + setGateways(_ => connectorList) setScreenState(_ => PageLoaderWrapper.Success) } else { setScreenState(_ => PageLoaderWrapper.Custom) @@ -147,21 +137,10 @@ let make = ( let merchantConnectorId = gateway->getDictFromJsonObject->getString("merchant_connector_id", "") let connectorLabel = ConnectorTableUtils.getConnectorObjectFromListViaId( - connectorList, + typedConnectorValue, merchantConnectorId, ).connector_label - let connector = - connectorList - ->Array.filter(item => - item.merchant_connector_id === - gateway->getDictFromJsonObject->getString("merchant_connector_id", "") - ) - ->Array.get(0) - ->Option.getOr(Dict.make()->ConnectorListMapper.getProcessorPayloadType) - - let isDisabled = connector.disabled -
@@ -174,9 +153,6 @@ let make = (

{connectorName->React.string}

{`(${connectorLabel})`->React.string}

- -

{"(disabled)"->React.string}

-
diff --git a/src/screens/Routing/RoutingConfigure.res b/src/screens/Routing/RoutingConfigure.res index cbc4504d4..2ce4e126b 100644 --- a/src/screens/Routing/RoutingConfigure.res +++ b/src/screens/Routing/RoutingConfigure.res @@ -53,8 +53,7 @@ let make = (~routingType) => { urlEntityName=ROUTING baseUrlForRedirection /> - | DEFAULTFALLBACK => - + | DEFAULTFALLBACK => | _ => <> }}