diff --git a/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebit.res b/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebit.res index 9a6de8f4f..c9cb3f4b0 100644 --- a/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebit.res +++ b/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebit.res @@ -54,7 +54,7 @@ module PMAuthProcessorInput = { } { - onCloseClickCustomFun() + update() onCancelClick() setShowWalletConfigurationModal(_ => false) } @@ -145,6 +144,7 @@ let make = ( ~label=`${inputArg.label}`, ~comboCustomInput=renderValueInp(inputArg.options), ~inputFields=[makeInputFieldInfo(~name=`${inputArg.name1}`), makeInputFieldInfo(~name=``)], + ~isRequired=true, (), ) } @@ -167,6 +167,7 @@ let make = ( }} text="Proceed" buttonType={Primary} + buttonState={validateSelectedPMAuth(formState.values, paymentMethodType)} /> diff --git a/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebitUtils.res b/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebitUtils.res index e09a8b8ac..1067cf9db 100644 --- a/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebitUtils.res +++ b/src/screens/Connectors/ConnectorMetaData/BankDebit/BankDebitUtils.res @@ -16,3 +16,18 @@ let itemToObjMapper = dict => { mca_id: dict->getString("mca_id", ""), } } + +let validateSelectedPMAuth = (values, paymentMethodType) => { + let existingPaymentMethodValues = + values + ->getDictFromJsonObject + ->getDictfromDict("pm_auth_config") + ->getArrayFromDict("enabled_payment_methods", []) + ->JSON.Encode.array + ->getArrayDataFromJson(itemToObjMapper) + + let newPaymentMethodValues = + existingPaymentMethodValues->Array.filter(item => item.payment_method_type == paymentMethodType) + + newPaymentMethodValues->Array.length > 0 ? Button.Normal : Button.Disabled +} diff --git a/src/screens/Connectors/PaymentMethodAdditionalDetails/AdditionalDetailsSidebar.res b/src/screens/Connectors/PaymentMethodAdditionalDetails/AdditionalDetailsSidebar.res index 3a9d83ebd..c2ec07ab1 100644 --- a/src/screens/Connectors/PaymentMethodAdditionalDetails/AdditionalDetailsSidebar.res +++ b/src/screens/Connectors/PaymentMethodAdditionalDetails/AdditionalDetailsSidebar.res @@ -31,7 +31,6 @@ module AdditionalDetailsSidebarComp = {