From 2259ca01628f0871e59da2d33bb5ce867435176a Mon Sep 17 00:00:00 2001 From: Riddhi Agrawal Date: Tue, 12 Dec 2023 15:28:10 +0530 Subject: [PATCH] fix: Quick start changes --- .../WooCommerce/WooCommerceUIUtils.res | 13 +++- .../ConfigureConnector.res | 22 +++--- .../QuickStartConnectorFlow.res | 8 ++- src/screens/HyperSwitch/Home/HomeUtils.res | 2 +- src/screens/HyperSwitch/Home/HomeV2.res | 28 +++++--- .../Home/ProdIntent/ProdIntentForm.res | 30 +------- .../Home/ProdIntent/ProdVerifyModal.res | 24 +------ .../HyperSwitch/Home/QuickStart/GoLive.res | 32 ++------- .../Home/QuickStart/QuickStartTypes.res | 7 +- .../Home/QuickStart/QuickStartUIUtils.res | 7 +- .../Home/QuickStart/QuickStartUtils.res | 70 ++++++++++++------- 11 files changed, 104 insertions(+), 139 deletions(-) diff --git a/src/entryPoints/hyperswitch/WooCommerce/WooCommerceUIUtils.res b/src/entryPoints/hyperswitch/WooCommerce/WooCommerceUIUtils.res index 84b4a0c03..3080f7589 100644 --- a/src/entryPoints/hyperswitch/WooCommerce/WooCommerceUIUtils.res +++ b/src/entryPoints/hyperswitch/WooCommerce/WooCommerceUIUtils.res @@ -49,6 +49,7 @@ module SelectPaymentMethods = { ~setButtonState: (Button.buttonState => Button.buttonState) => unit, ~buttonState, ) => { + open QuickStartUtils let updateEnumInRecoil = EnumVariantHook.useUpdateEnumInRecoil() let enumDetails = Recoil.useRecoilValueFromAtom(HyperswitchAtom.enumVariantAtom) let updateAPIHook = APIUtils.useUpdateMethod() @@ -83,9 +84,15 @@ module SelectPaymentMethods = { enumRecoilUpdateArr->Array.push((body, #FirstProcessorConnected)) } - if !enums.isMultipleConfiguration { - let _ = await Boolean(true)->postEnumDetails(#IsMultipleConfiguration) - enumRecoilUpdateArr->Array.push((Boolean(true), #IsMultipleConfiguration)) + if enums.configurationType->Js.String2.length === 0 { + let _ = + await StringEnumType( + #MultipleProcessorWithSmartRouting->connectorChoiceVariantToString, + )->postEnumDetails(#ConfigurationType) + enumRecoilUpdateArr->Array.push(( + StringEnumType(#MultipleProcessorWithSmartRouting->connectorChoiceVariantToString), + #ConfigurationType, + )) } let _ = updateEnumInRecoil(enumRecoilUpdateArr) diff --git a/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res b/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res index 3f539e137..568c1844f 100644 --- a/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res +++ b/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res @@ -21,11 +21,7 @@ let make = (~connectProcessorValue: connectProcessor) => { let (selectedConnector, setSelectedConnector) = React.useState(_ => UnknownConnector("")) let (initialValues, setInitialValues) = React.useState(_ => Js.Dict.empty()->Js.Json.object_) let (connectorConfigureState, setConnectorConfigureState) = React.useState(_ => Select_processor) - let (choiceState, setChoiceState) = React.useState(_ => - typedEnumValue.isMultipleConfiguration - ? #MultipleProcessorWithSmartRouting - : #SinglePaymentProcessor - ) + let (choiceState, setChoiceState) = React.useState(_ => #NotSelected) let (smartRoutingChoiceState, setSmartRoutingChoiceState) = React.useState(_ => #DefaultFallback) let (choiceStateForTestConnector, setChoiceStateForTestConnector) = React.useState(_ => #TestApiKeys @@ -102,12 +98,10 @@ let make = (~connectProcessorValue: connectProcessor) => { } } - let updateEnumForMultipleConfigurationType = async isMultipleConfigSelected => { + let updateEnumForMultipleConfigurationType = async connectorChoiceValue => { try { - let isMultipleConfigurationType = #IsMultipleConfiguration - let _ = await ConnectorChoice({ - isMultipleConfiguration: isMultipleConfigSelected, - })->usePostEnumDetails(isMultipleConfigurationType) + let configurationType = #ConfigurationType + let _ = await StringEnumType(connectorChoiceValue)->usePostEnumDetails(configurationType) } catch { | Js.Exn.Error(e) => { let err = Js.Exn.message(e)->Belt.Option.getWithDefault("Failed to update!") @@ -119,14 +113,18 @@ let make = (~connectProcessorValue: connectProcessor) => { try { setButtonState(_ => Loading) if choiceState === #MultipleProcessorWithSmartRouting { - let _ = await updateEnumForMultipleConfigurationType(true) + let _ = await updateEnumForMultipleConfigurationType( + #MultipleProcessorWithSmartRouting->connectorChoiceVariantToString, + ) setQuickStartPageState(_ => typedEnumValue.firstProcessorConnected.processorID->Js.String2.length > 0 ? ConnectProcessor(CONFIGURE_SECONDARY) : ConnectProcessor(CONFIGURE_PRIMARY) ) } else { - let _ = await updateEnumForMultipleConfigurationType(false) + let _ = await updateEnumForMultipleConfigurationType( + #SinglePaymentProcessor->connectorChoiceVariantToString, + ) setQuickStartPageState(_ => typedEnumValue.firstProcessorConnected.processorID->Js.String2.length > 0 ? ConnectProcessor(CHECKOUT) diff --git a/src/screens/HyperSwitch/Home/CommonConnectorFlow/QuickStartConnectorFlow.res b/src/screens/HyperSwitch/Home/CommonConnectorFlow/QuickStartConnectorFlow.res index f9c0cf5a2..a708b8d99 100644 --- a/src/screens/HyperSwitch/Home/CommonConnectorFlow/QuickStartConnectorFlow.res +++ b/src/screens/HyperSwitch/Home/CommonConnectorFlow/QuickStartConnectorFlow.res @@ -38,10 +38,14 @@ let make = ( let handleSummaryProceed = () => { if ( connectorArray->Js.Array2.length === multipleConfigurationArrayLength && - typedEnumValue.isMultipleConfiguration + typedEnumValue.configurationType->connectorChoiceStringVariantMapper === + #MultipleProcessorWithSmartRouting ) { setQuickStartPageState(_ => ConnectProcessor(CONFIGURE_SMART_ROUTING)) - } else if !typedEnumValue.isMultipleConfiguration { + } else if ( + typedEnumValue.configurationType->connectorChoiceStringVariantMapper === + #SinglePaymentProcessor + ) { setQuickStartPageState(_ => QuickStartTypes.ConnectProcessor(QuickStartTypes.CHECKOUT)) } else { setSelectedConnector(_ => UnknownConnector("")) diff --git a/src/screens/HyperSwitch/Home/HomeUtils.res b/src/screens/HyperSwitch/Home/HomeUtils.res index 6a8e17293..851ca24de 100644 --- a/src/screens/HyperSwitch/Home/HomeUtils.res +++ b/src/screens/HyperSwitch/Home/HomeUtils.res @@ -460,11 +460,11 @@ let getValueMapped = (value, key) => { | #ConfigureWoocom | #SetupWoocomWebhook => value->getBool(key, false)->Js.Json.boolean + | #ConfigurationType => value->getString(key, "")->Js.Json.string | #FirstProcessorConnected | #SecondProcessorConnected | #StripeConnected | #PaypalConnected - | #IsMultipleConfiguration | #IntegrationMethod => value->getJsonObjectFromDict(key) | #TestPayment => value->getJsonObjectFromDict(key) diff --git a/src/screens/HyperSwitch/Home/HomeV2.res b/src/screens/HyperSwitch/Home/HomeV2.res index e715aede1..3cce912bf 100644 --- a/src/screens/HyperSwitch/Home/HomeV2.res +++ b/src/screens/HyperSwitch/Home/HomeV2.res @@ -71,6 +71,7 @@ module HomePageHorizontalStepper = { module QuickStart = { @react.component let make = (~isMobileView) => { + open QuickStartUtils let {setDashboardPageState, setQuickStartPageState} = React.useContext( GlobalProvider.defaultContext, ) @@ -90,7 +91,7 @@ module QuickStart = { let typedConnectorValue = connectorList->getArrayOfConnectorListPayloadType if ( - !typedValueOfEnum.isMultipleConfiguration && + typedValueOfEnum.configurationType->Js.String2.length === 0 && typedValueOfEnum.firstProcessorConnected.processorID->Js.String2.length === 0 && typedValueOfEnum.secondProcessorConnected.processorID->Js.String2.length === 0 ) { @@ -115,9 +116,11 @@ module QuickStart = { processorName: secondConnectorValue.connector_name, } - let _isMultipleConnectorSetup = await ConnectorChoice({ - isMultipleConfiguration: true, - })->usePostEnumDetails(#IsMultipleConfiguration) + let _connectorChoiceSetup = + await StringEnumType( + #MultipleProcessorWithSmartRouting->connectorChoiceVariantToString, + )->usePostEnumDetails(#ConfigurationType) + let _firstEnumSetupValues = await ProcesorType(bodyOfFirstConnector)->usePostEnumDetails(#FirstProcessorConnected) let _secondEnumSetupValues = @@ -125,7 +128,10 @@ module QuickStart = { #SecondProcessorConnected, ) let _ = updateEnumInRecoil([ - (Boolean(true), #IsMultipleConfiguration), + ( + StringEnumType(#MultipleProcessorWithSmartRouting->connectorChoiceVariantToString), + #ConfigurationType, + ), (ProcesorType(bodyOfFirstConnector), #FirstProcessorConnected), (ProcesorType(bodyOfSecondConnector), #SecondProcessorConnected), ]) @@ -141,13 +147,17 @@ module QuickStart = { processorName: firstConnectorValue.connector_name, } - let _isMultipleConnectorSetup = await ConnectorChoice({ - isMultipleConfiguration: true, - })->usePostEnumDetails(#IsMultipleConfiguration) + let _connectorChoiceSetup = + await StringEnumType( + #MultipleProcessorWithSmartRouting->connectorChoiceVariantToString, + )->usePostEnumDetails(#ConfigurationType) let _firstEnumSetupValues = await ProcesorType(bodyOfFirstConnector)->usePostEnumDetails(#FirstProcessorConnected) let _ = updateEnumInRecoil([ - (ConnectorChoice({isMultipleConfiguration: true}), #IsMultipleConfiguration), + ( + StringEnumType(#MultipleProcessorWithSmartRouting->connectorChoiceVariantToString), + #ConfigurationType, + ), (ProcesorType(bodyOfFirstConnector), #FirstProcessorConnected), ]) setQuickStartPageState(_ => ConnectProcessor(CONFIGURE_SECONDARY)) diff --git a/src/screens/HyperSwitch/Home/ProdIntent/ProdIntentForm.res b/src/screens/HyperSwitch/Home/ProdIntent/ProdIntentForm.res index baff45a82..82f1b14fd 100644 --- a/src/screens/HyperSwitch/Home/ProdIntent/ProdIntentForm.res +++ b/src/screens/HyperSwitch/Home/ProdIntent/ProdIntentForm.res @@ -4,35 +4,13 @@ let make = (~isFromMilestoneCard=false) => { open ProdVerifyModalUtils let fetchDetails = useGetMethod() - let updateDetails = useUpdateMethod() let email = HSLocalStorage.getFromMerchantDetails("email") - let { - showProdIntentForm, - setShowProdIntentForm, - dashboardPageState, - integrationDetails, - setIntegrationDetails, - setIsProdIntentCompleted, - } = React.useContext(GlobalProvider.defaultContext) + let {showProdIntentForm, setShowProdIntentForm, setIsProdIntentCompleted} = React.useContext( + GlobalProvider.defaultContext, + ) let (initialValues, setInitialValues) = React.useState(_ => Js.Dict.empty()) - let markAsDone = async () => { - try { - let url = getURL(~entityName=INTEGRATION_DETAILS, ~methodType=Post, ()) - let body = HSwitchUtils.constructOnboardingBody( - ~dashboardPageState, - ~integrationDetails, - ~is_done=true, - (), - ) - let _ = await updateDetails(url, body, Post) - setIntegrationDetails(_ => body->ProviderHelper.getIntegrationDetails) - } catch { - | _ => () - } - } - let getProdVerifyDetails = async () => { open LogicUtils try { @@ -50,8 +28,6 @@ let make = (~isFromMilestoneCard=false) => { setIsProdIntentCompleted(_ => hideHeader) if !hideHeader { valueForProdIntent->Js.Dict.set(POCemail->getStringFromVariant, email->Js.Json.string) - } else if !integrationDetails.account_activation.is_done { - markAsDone()->ignore } setInitialValues(_ => valueForProdIntent) } catch { diff --git a/src/screens/HyperSwitch/Home/ProdIntent/ProdVerifyModal.res b/src/screens/HyperSwitch/Home/ProdIntent/ProdVerifyModal.res index cab3d0388..41655404d 100644 --- a/src/screens/HyperSwitch/Home/ProdIntent/ProdVerifyModal.res +++ b/src/screens/HyperSwitch/Home/ProdIntent/ProdVerifyModal.res @@ -10,28 +10,7 @@ let make = (~showModal, ~setShowModal, ~initialValues=Js.Dict.empty(), ~getProdV let showToast = ToastState.useShowToast() let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Success) let (isSubmitBtnDisabled, setIsSubmitBtnDisabled) = React.useState(_ => false) - let { - dashboardPageState, - integrationDetails, - setIntegrationDetails, - setShowProdIntentForm, - } = React.useContext(GlobalProvider.defaultContext) - - let markAsDone = async () => { - try { - let url = getURL(~entityName=INTEGRATION_DETAILS, ~methodType=Post, ()) - let body = HSwitchUtils.constructOnboardingBody( - ~dashboardPageState, - ~integrationDetails, - ~is_done=true, - (), - ) - let _ = await updateDetails(url, body, Post) - setIntegrationDetails(_ => body->ProviderHelper.getIntegrationDetails) - } catch { - | _ => () - } - } + let {setShowProdIntentForm} = React.useContext(GlobalProvider.defaultContext) let updateProdDetails = async values => { try { @@ -47,7 +26,6 @@ let make = (~showModal, ~setShowModal, ~initialValues=Js.Dict.empty(), ~getProdV ) setScreenState(_ => Success) getProdVerifyDetails()->ignore - markAsDone()->ignore setShowProdIntentForm(_ => false) } catch { | _ => setShowModal(_ => false) diff --git a/src/screens/HyperSwitch/Home/QuickStart/GoLive.res b/src/screens/HyperSwitch/Home/QuickStart/GoLive.res index 3aa55004e..90bdce53e 100644 --- a/src/screens/HyperSwitch/Home/QuickStart/GoLive.res +++ b/src/screens/HyperSwitch/Home/QuickStart/GoLive.res @@ -34,31 +34,9 @@ let make = (~goLive) => { let (initialValues, setInitialValues) = React.useState(_ => Js.Dict.empty()) let {isProdIntentCompleted} = React.useContext(GlobalProvider.defaultContext) let (isSubmitBtnDisabled, setIsSubmitBtnDisabled) = React.useState(_ => false) - let { - dashboardPageState, - integrationDetails, - setIntegrationDetails, - setIsProdIntentCompleted, - setQuickStartPageState, - setDashboardPageState, - } = React.useContext(GlobalProvider.defaultContext) - - let markAsDone = async () => { - try { - let url = getURL(~entityName=INTEGRATION_DETAILS, ~methodType=Post, ()) - let body = HSwitchUtils.constructOnboardingBody( - ~dashboardPageState, - ~integrationDetails, - ~is_done=true, - (), - ) - let _ = await updateDetails(url, body, Post) - setIntegrationDetails(_ => body->ProviderHelper.getIntegrationDetails) - setQuickStartPageState(_ => FinalLandingPage) - } catch { - | _ => () - } - } + let {setIsProdIntentCompleted, setQuickStartPageState, setDashboardPageState} = React.useContext( + GlobalProvider.defaultContext, + ) let getProdVerifyDetails = async () => { open LogicUtils @@ -78,9 +56,8 @@ let make = (~goLive) => { setIsProdIntentCompleted(_ => hideHeader) if !hideHeader { valueForProdIntent->Js.Dict.set(POCemail->getStringFromVariant, email->Js.Json.string) - } else if !integrationDetails.account_activation.is_done { - markAsDone()->ignore } + setQuickStartPageState(_ => FinalLandingPage) setInitialValues(_ => valueForProdIntent) } catch { | _ => () @@ -95,7 +72,6 @@ let make = (~goLive) => { let _ = await updateDetails(url, body, Post) getProdVerifyDetails()->ignore - markAsDone()->ignore } catch { | _ => () } diff --git a/src/screens/HyperSwitch/Home/QuickStart/QuickStartTypes.res b/src/screens/HyperSwitch/Home/QuickStart/QuickStartTypes.res index caa84a5ac..35969bfc1 100644 --- a/src/screens/HyperSwitch/Home/QuickStart/QuickStartTypes.res +++ b/src/screens/HyperSwitch/Home/QuickStart/QuickStartTypes.res @@ -58,7 +58,7 @@ type sectionHeadingVariant = [ | #DownloadWoocom | #ConfigureWoocom | #SetupWoocomWebhook - | #IsMultipleConfiguration + | #ConfigurationType | #GoLive | #DownloadTestAPIKeyStripe | #InstallDeps @@ -76,7 +76,6 @@ type routingType = {routing_id: string} type paymentType = {payment_id: string} type integrationMethod = {integration_type: string} -type connectorChoice = {isMultipleConfiguration: bool} type responseType = { productionAgreement: bool, @@ -93,7 +92,6 @@ type responseType = { downloadWoocom: bool, configureWoocom: bool, setupWoocomWebhook: bool, - isMultipleConfiguration: bool, downloadTestAPIKeyStripe: string, installDeps: string, replaceAPIKeys: string, @@ -103,6 +101,7 @@ type responseType = { createPayment: string, displayCheckout: string, displayPaymentConfirmation: string, + configurationType: string, } type requestObjectType = @@ -110,8 +109,8 @@ type requestObjectType = | RoutingType(routingType) | PaymentType(paymentType) | IntegrationMethod(integrationMethod) - | ConnectorChoice(connectorChoice) | Boolean(bool) | String(string) + | StringEnumType(string) type valueType = String(string) | Boolean(bool) diff --git a/src/screens/HyperSwitch/Home/QuickStart/QuickStartUIUtils.res b/src/screens/HyperSwitch/Home/QuickStart/QuickStartUIUtils.res index 6fa92deb8..cc3c84476 100644 --- a/src/screens/HyperSwitch/Home/QuickStart/QuickStartUIUtils.res +++ b/src/screens/HyperSwitch/Home/QuickStart/QuickStartUIUtils.res @@ -178,7 +178,6 @@ module HorizontalChoiceTile = { } module LandingPageChoice = { - open QuickStartTypes @react.component let make = ( ~choiceState, @@ -193,11 +192,7 @@ module LandingPageChoice = { ~customLayoutCss="", ) => { React.useEffect0(() => { - let defaultValue = - listChoices - ->Belt.Array.get(0) - ->Belt.Option.getWithDefault(QuickStartUtils.defaultChoiceStateValue) - setChoiceState(_ => defaultValue.variantType) + setChoiceState(_ => #NotSelected) None }) diff --git a/src/screens/HyperSwitch/Home/QuickStart/QuickStartUtils.res b/src/screens/HyperSwitch/Home/QuickStart/QuickStartUtils.res index 7de1e90e6..c3da5a51c 100644 --- a/src/screens/HyperSwitch/Home/QuickStart/QuickStartUtils.res +++ b/src/screens/HyperSwitch/Home/QuickStart/QuickStartUtils.res @@ -17,7 +17,7 @@ let getTestConnectorName = (connector, quickStartPageState) => { } let quickStartEnumIntialArray: array = [ - #IsMultipleConfiguration, + #ConfigurationType, #FirstProcessorConnected, #SecondProcessorConnected, #ConfiguredRouting, @@ -31,13 +31,21 @@ let quickStartEnumIntialArray: array = [ #PaypalConnected, #SPTestPayment, ] -let getInitalEnumArray: bool => array = isMultipleConfiguration => { - if isMultipleConfiguration { - quickStartEnumIntialArray - } else { - [#FirstProcessorConnected, #TestPayment, #IntegrationMethod, #IntegrationCompleted] + +let connectorChoiceStringVariantMapper = stringValue => + switch stringValue { + | "" => #NotSelected + | "Single" => #SinglePaymentProcessor + | "Multiple" | _ => #MultipleProcessorWithSmartRouting } -} + +let connectorChoiceVariantToString = variantValue => + switch variantValue { + | #SinglePaymentProcessor => "Single" + | #MultipleProcessorWithSmartRouting => "Multiple" + | _ => "" + } + let defaultChoiceStateValue: landingChoiceType = { displayText: "Not Selected", description: "Not Selected", @@ -189,12 +197,12 @@ let getTypedValueFromDict = valueString => { downloadWoocom: value->getBool(#DownloadWoocom->getStringFromVariant, false), configureWoocom: value->getBool(#ConfigureWoocom->getStringFromVariant, false), setupWoocomWebhook: value->getBool(#SetupWoocomWebhook->getStringFromVariant, false), - isMultipleConfiguration: value->getBool(#IsMultipleConfiguration->getStringFromVariant, false), downloadTestAPIKeyStripe: value->getString(#DownloadTestAPIKeyStripe->getStringFromVariant, ""), installDeps: value->getString(#InstallDeps->getStringFromVariant, ""), replaceAPIKeys: value->getString(#ReplaceAPIKeys->getStringFromVariant, ""), reconfigureCheckout: value->getString(#ReconfigureCheckout->getStringFromVariant, ""), loadCheckout: value->getString(#LoadCheckout->getStringFromVariant, ""), + configurationType: value->getString(#ConfigurationType->getStringFromVariant, ""), } typedValue } @@ -220,7 +228,7 @@ let variantToEnumMapper = variantValue => { } let enumToVarinatMapper = enum => switch enum { - | #IsMultipleConfiguration => ConnectProcessor(LANDING) + | #ConfigurationType => ConnectProcessor(LANDING) | #FirstProcessorConnected => ConnectProcessor(CONFIGURE_PRIMARY) | #SecondProcessorConnected => ConnectProcessor(CONFIGURE_SECONDARY) | #ConfiguredRouting => ConnectProcessor(CONFIGURE_SMART_ROUTING) @@ -424,7 +432,10 @@ let getSidebarOptionsForConnectProcessor: ( open LogicUtils let enumValue = enumDetails->safeParse->getTypedValueFromDict let currentPageStateEnum = quickStartPageState->variantToEnumMapper - if enumValue.isMultipleConfiguration { + if ( + enumValue.configurationType->connectorChoiceStringVariantMapper === + #MultipleProcessorWithSmartRouting + ) { [ { title: "Connect primary processor", @@ -548,6 +559,7 @@ let stringToVariantMapperForUserData = str => | "DownloadWoocom" => #DownloadWoocom | "ConfigureWoocom" => #ConfigureWoocom | "SetupWoocomWebhook" => #SetupWoocomWebhook + | "ConfigurationType" => #ConfigurationType | _ => #ProductionAgreement } @@ -588,13 +600,10 @@ let generateBodyBasedOnType = (parentVariant: sectionHeadingVariant, value: requ ]->getJsonFromArrayOfJson, ), ]->getJsonFromArrayOfJson - | ConnectorChoice(selectedChoice) => - [ - ((parentVariant :> string), selectedChoice.isMultipleConfiguration->Js.Json.boolean), - ]->getJsonFromArrayOfJson - | Boolean(_) => (parentVariant :> string)->Js.Json.string | String(str) => str->Js.Json.string + | StringEnumType(stringValue) => + [((parentVariant :> string), stringValue->Js.Json.string)]->getJsonFromArrayOfJson } } @@ -619,26 +628,34 @@ let checkBool = (dict, variant) => { dict->getBool(variant->getStringFromVariant, false) } +let checkString = (dict, variant) => { + open LogicUtils + dict->getString(variant->getStringFromVariant, "") +} + let getCurrentStep = dict => { + Js.log2("dictdict", dict) if ( // 1.IsMultipleConfiguration false // 2.FirstProcessorConnected dict is empty - dict->checkBool(#IsMultipleConfiguration) === false && + dict->checkString(#ConfigurationType)->Js.String2.length === 0 && dict->checkEmptyDict(#FirstProcessorConnected) ) { - #IsMultipleConfiguration + #ConfigurationType } else if ( // 1.IsMultipleConfiguration true // 2.FirstProcessorConnected dict is empty - dict->checkBool(#IsMultipleConfiguration) && dict->checkEmptyDict(#FirstProcessorConnected) + dict->checkString(#ConfigurationType)->connectorChoiceStringVariantMapper === + #MultipleProcessorWithSmartRouting && dict->checkEmptyDict(#FirstProcessorConnected) ) { #FirstProcessorConnected } else if ( // 1.IsMultipleConfiguration true // 2.FirstProcessorConnected dict is not empty // 3.SecondProcessorConnected dict is empty - dict->checkBool(#IsMultipleConfiguration) && + dict->checkString(#ConfigurationType)->connectorChoiceStringVariantMapper === + #MultipleProcessorWithSmartRouting && !(dict->checkEmptyDict(#FirstProcessorConnected)) && dict->checkEmptyDict(#SecondProcessorConnected) ) { @@ -648,7 +665,8 @@ let getCurrentStep = dict => { // 2.FirstProcessorConnected dict is not empty // 3.SecondProcessorConnected dict is not empty // 4.ConfiguredRouting dict is empty - dict->checkBool(#IsMultipleConfiguration) && + dict->checkString(#ConfigurationType)->connectorChoiceStringVariantMapper === + #MultipleProcessorWithSmartRouting && !(dict->checkEmptyDict(#FirstProcessorConnected)) && !(dict->checkEmptyDict(#SecondProcessorConnected)) && dict->checkEmptyDict(#ConfiguredRouting) @@ -660,7 +678,8 @@ let getCurrentStep = dict => { // 3.SecondProcessorConnected dict is not empty // 4.ConfigureRouting dict is not empty // 5.TestPayment dict is empty - dict->checkBool(#IsMultipleConfiguration) && + dict->checkString(#ConfigurationType)->connectorChoiceStringVariantMapper === + #MultipleProcessorWithSmartRouting && !(dict->checkEmptyDict(#FirstProcessorConnected)) && !(dict->checkEmptyDict(#SecondProcessorConnected)) && !(dict->checkEmptyDict(#ConfiguredRouting)) && @@ -673,7 +692,8 @@ let getCurrentStep = dict => { // 3.SecondProcessorConnected dict is not empty // 4.ConfiguredRouting dict is not empty // 5.IntegrationMethod dict is empty - dict->checkBool(#IsMultipleConfiguration) && + dict->checkString(#ConfigurationType)->connectorChoiceStringVariantMapper === + #MultipleProcessorWithSmartRouting && !(dict->checkEmptyDict(#FirstProcessorConnected)) && !(dict->checkEmptyDict(#SecondProcessorConnected)) && !(dict->checkEmptyDict(#ConfiguredRouting)) && @@ -683,7 +703,8 @@ let getCurrentStep = dict => { } else if ( // 1.IsMultipleConfiguration false // 2.FirstProcessorConnected dict is not empty - !(dict->checkBool(#IsMultipleConfiguration)) && + dict->checkString(#ConfigurationType)->connectorChoiceStringVariantMapper === + #SinglePaymentProcessor && !(dict->checkEmptyDict(#FirstProcessorConnected)) && dict->checkEmptyDict(#TestPayment) === true ) { @@ -692,7 +713,8 @@ let getCurrentStep = dict => { // 1.IsMultipleConfiguration false // 2.FirstProcessorConnected dict is not empty // 3.IntegrationMethod dict is empty - !(dict->checkBool(#IsMultipleConfiguration)) && + dict->checkString(#ConfigurationType)->connectorChoiceStringVariantMapper === + #SinglePaymentProcessor && !(dict->checkEmptyDict(#FirstProcessorConnected)) && dict->checkEmptyDict(#IntegrationMethod) === true ) {