diff --git a/README.md b/README.md index 8420c0dca..0a849af3f 100644 --- a/README.md +++ b/README.md @@ -136,9 +136,9 @@ The `home_page` feature flag controls whether the dashboard home page is enabled The `test_live_toggle` feature flag enables users to toggle between test and live modes when signing in. When enabled, users will see an option during sign-in to actively switch between test and live environments. -#### Test Live Mode +#### Is Live Mode -The `test_live_mode` feature flag enables displaying the current mode - test or live - that the user is accessing. When enabled, it will show a visual indicator within the dashboard signaling whether the user is currently in a test environment or live production environment. +The `is_live_mode` feature flag enables the live mode - that the user is accessing. When enabled, it will show a visual indicator within the dashboard signaling whether the user is currently in a test environment or live production environment. #### Magic Link @@ -152,10 +152,6 @@ The `production_access` feature flag enables a flow for users to request live pr The `quick_start` feature flag enables the simplified onboarding flow for new users, where he connects to processors, configure payment routing and testing a payment, all in one flow. -#### Open SDK - -The `open_sdk` feature flag enables access to the Checkout Page web SDK from within the dashboard. When enabled, developers can preview the SDK from within the dashboard and make payments. - --- ## Deployment diff --git a/config/FeatureFlag.json b/config/FeatureFlag.json index 99a695198..b31e3882e 100644 --- a/config/FeatureFlag.json +++ b/config/FeatureFlag.json @@ -1,10 +1,9 @@ { "test_live_toggle": false, - "test_live_mode": false, + "is_live_mode": false, "magic_link": false, "production_access": false, "quick_start": false, - "open_sdk": false, "switch_merchant": false, "audit_trail": false, "system_metrics": false, diff --git a/src/entryPoints/hyperswitch/FeatureFlagUtils.res b/src/entryPoints/hyperswitch/FeatureFlagUtils.res index fa322ff39..8d1eda500 100644 --- a/src/entryPoints/hyperswitch/FeatureFlagUtils.res +++ b/src/entryPoints/hyperswitch/FeatureFlagUtils.res @@ -4,9 +4,8 @@ type featureFlag = { testLiveToggle: bool, magicLink: bool, quickStart: bool, - openSDK: bool, switchMerchant: bool, - testLiveMode: bool, + isLiveMode: bool, auditTrail: bool, systemMetrics: bool, sampleData: bool, @@ -32,9 +31,8 @@ let featureFlagType = (featureFlags: Js.Json.t) => { testLiveToggle: dict->getBool("test_live_toggle", false), magicLink: dict->getBool("magic_link", false), quickStart: dict->getBool("quick_start", false), - openSDK: dict->getBool("open_sdk", false), switchMerchant: dict->getBool("switch_merchant", false), - testLiveMode: dict->getBool("test_live_mode", false), + isLiveMode: dict->getBool("is_live_mode", false), auditTrail: dict->getBool("audit_trail", false), systemMetrics: dict->getBool("system_metrics", false), sampleData: dict->getBool("sample_data", false), diff --git a/src/entryPoints/hyperswitch/HyperSwitchApp.res b/src/entryPoints/hyperswitch/HyperSwitchApp.res index a23eeb93e..309be7437 100644 --- a/src/entryPoints/hyperswitch/HyperSwitchApp.res +++ b/src/entryPoints/hyperswitch/HyperSwitchApp.res @@ -50,10 +50,10 @@ let make = () => { let getEnumDetails = EnumVariantHook.useFetchEnumDetails() let verificationDays = getFromMerchantDetails("verification")->LogicUtils.getIntFromString(-1) let userRole = getFromUserDetails("user_role") - let modeText = featureFlagDetails.testLiveMode ? "Live Mode" : "Test Mode" + let modeText = featureFlagDetails.isLiveMode ? "Live Mode" : "Test Mode" let titleComingSoonMessage = "Coming Soon!" let subtitleComingSoonMessage = "We are currently working on this page." - let modeStyles = featureFlagDetails.testLiveMode + let modeStyles = featureFlagDetails.isLiveMode ? "bg-hyperswitch_green_trans border-hyperswitch_green_trans text-hyperswitch_green" : "bg-orange-600/80 border-orange-500 text-grey-700" @@ -125,7 +125,7 @@ let make = () => { let _featureFlag = await fetchInitialEnums() } - if featureFlagDetails.testLiveMode { + if featureFlagDetails.isLiveMode { getAgreementEnum()->ignore } else { setDashboardPageState(_ => #HOME) @@ -331,7 +331,7 @@ let make = () => { | list{"sdk"} => - + | list{"3ds"} => diff --git a/src/entryPoints/hyperswitch/HyperSwitchEntry.res b/src/entryPoints/hyperswitch/HyperSwitchEntry.res index c8a4b29cc..2ab9ea88c 100644 --- a/src/entryPoints/hyperswitch/HyperSwitchEntry.res +++ b/src/entryPoints/hyperswitch/HyperSwitchEntry.res @@ -43,7 +43,7 @@ module HyperSwitchEntryComponent = { let setPageName = pageTitle => { let page = pageTitle->LogicUtils.snakeToTitle - let title = featureFlagDetails.testLiveMode + let title = featureFlagDetails.isLiveMode ? `${page} - Dashboard` : `${page} - Dashboard [Test]` DOMUtils.document.title = title diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res index 95b1456ce..f1075e08b 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res @@ -343,7 +343,7 @@ let make = ( ~connector, ~bodyType, ~isPayoutFlow, - ~isLiveMode={featureFlagDetails.testLiveMode}, + ~isLiveMode={featureFlagDetails.isLiveMode}, (), ) setScreenState(_ => Loading) @@ -396,7 +396,7 @@ let make = ( ~connector, ~bodyType, ~isPayoutFlow, - ~isLiveMode={featureFlagDetails.testLiveMode}, + ~isLiveMode={featureFlagDetails.isLiveMode}, (), )->ignoreFields(connectorID, verifyConnectorIgnoreField) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 050a1f127..9bbb1c54e 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -132,7 +132,7 @@ module RenderConnectorInputFields = { ~selectedConnector, ~dict=details, ~fieldName=formName, - ~isLiveMode={featureFlagDetails.testLiveMode}, + ~isLiveMode={featureFlagDetails.isLiveMode}, )} /> diff --git a/src/screens/HyperSwitch/Connectors/ConnectorList.res b/src/screens/HyperSwitch/Connectors/ConnectorList.res index 9abaa340a..91f6dccc4 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorList.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorList.res @@ -11,7 +11,7 @@ module NewProcessorCards = { ->LogicUtils.safeParse ->FeatureFlagUtils.featureFlagType - let connectorsAvailableForIntegration = featureFlagDetails.testLiveMode + let connectorsAvailableForIntegration = featureFlagDetails.isLiveMode ? ConnectorUtils.connectorListForLive : isPayoutFlow ? ConnectorUtils.payoutConnectorList diff --git a/src/screens/HyperSwitch/FraudAndRisk/FRMConfigure.res b/src/screens/HyperSwitch/FraudAndRisk/FRMConfigure.res index f3594d1c7..b6df5589b 100644 --- a/src/screens/HyperSwitch/FraudAndRisk/FRMConfigure.res +++ b/src/screens/HyperSwitch/FraudAndRisk/FRMConfigure.res @@ -32,7 +32,7 @@ let make = () => { setInitialValues(_ => { generateInitialValuesDict( ~selectedFRMInfo=frmInfo, - ~isLiveMode=featureFlagDetails.testLiveMode, + ~isLiveMode=featureFlagDetails.isLiveMode, (), ) }) diff --git a/src/screens/HyperSwitch/FraudAndRisk/FRMIntegrationFields.res b/src/screens/HyperSwitch/FraudAndRisk/FRMIntegrationFields.res index ca20884e5..0feccdd07 100644 --- a/src/screens/HyperSwitch/FraudAndRisk/FRMIntegrationFields.res +++ b/src/screens/HyperSwitch/FraudAndRisk/FRMIntegrationFields.res @@ -228,7 +228,7 @@ let make = ( } | None => - generateInitialValuesDict(~selectedFRMInfo, ~isLiveMode={featureFlagDetails.testLiveMode}, ()) + generateInitialValuesDict(~selectedFRMInfo, ~isLiveMode={featureFlagDetails.isLiveMode}, ()) } }, [retrivedValues]) diff --git a/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res b/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res index 3fec27740..cee497604 100644 --- a/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res +++ b/src/screens/HyperSwitch/Home/CommonConnectorFlow/ConfigureConnector.res @@ -6,7 +6,6 @@ let make = (~connectProcessorValue: connectProcessor) => { open QuickStartUtils open APIUtils let updateDetails = useUpdateMethod() - let usePostEnumDetails = EnumVariantHook.usePostEnumDetails() let {quickStartPageState, setQuickStartPageState, setDashboardPageState} = React.useContext( GlobalProvider.defaultContext, diff --git a/src/screens/HyperSwitch/Home/CommonConnectorFlow/SetupConnector.res b/src/screens/HyperSwitch/Home/CommonConnectorFlow/SetupConnector.res index 621364994..fd08653c9 100644 --- a/src/screens/HyperSwitch/Home/CommonConnectorFlow/SetupConnector.res +++ b/src/screens/HyperSwitch/Home/CommonConnectorFlow/SetupConnector.res @@ -91,7 +91,7 @@ module ConfigureProcessor = { ~connector=connectorName, ~bodyType, ~isPayoutFlow=false, - ~isLiveMode={featureFlagDetails.testLiveMode}, + ~isLiveMode={featureFlagDetails.isLiveMode}, (), ) setInitialValues(_ => body) diff --git a/src/screens/HyperSwitch/Home/HomeUtils.res b/src/screens/HyperSwitch/Home/HomeUtils.res index e87ce358c..5e90d7b80 100644 --- a/src/screens/HyperSwitch/Home/HomeUtils.res +++ b/src/screens/HyperSwitch/Home/HomeUtils.res @@ -269,7 +269,7 @@ module ControlCenter = { let url = RescriptReactRouter.useUrl() let hyperswitchMixPanel = HSMixPanel.useSendEvent() let merchantDetailsValue = useMerchantDetailsValue() - let {testLiveMode} = + let {isLiveMode} = HyperswitchAtom.featureFlagAtom ->Recoil.useRecoilValueFromAtom ->LogicUtils.safeParse @@ -277,13 +277,13 @@ module ControlCenter = { let pageName = url.path->getPageNameFromUrl - let isLiveModeEnabledStyles = testLiveMode + let isLiveModeEnabledStyles = isLiveMode ? "flex flex-col md:flex-row gap-5 w-full" : "flex flex-col gap-5 md:w-1/2 w-full"
- + - +
- +
diff --git a/src/screens/HyperSwitch/Order/OrderUIUtils.res b/src/screens/HyperSwitch/Order/OrderUIUtils.res index c84381ed3..24a37eb6b 100644 --- a/src/screens/HyperSwitch/Order/OrderUIUtils.res +++ b/src/screens/HyperSwitch/Order/OrderUIUtils.res @@ -81,14 +81,14 @@ module GenerateSampleDataButton = { module NoData = { @react.component let make = (~isConfigureConnector, ~paymentModal, ~setPaymentModal) => { - let {testLiveMode} = + let {isLiveMode} = HyperswitchAtom.featureFlagAtom ->Recoil.useRecoilValueFromAtom ->LogicUtils.safeParse ->FeatureFlagUtils.featureFlagType onProceed(~paymentId)->ignore} customWidth bgColor="bg-green-success_page_bg" + isButtonVisible={paymentId->Js.String2.length > 0} /> | FAILED(_err) => diff --git a/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/ProdOnboardingUIUtils.res b/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/ProdOnboardingUIUtils.res index 5728292af..996c8258b 100644 --- a/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/ProdOnboardingUIUtils.res +++ b/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/ProdOnboardingUIUtils.res @@ -137,20 +137,23 @@ module BasicAccountSetupSuccessfulPage = { ~customWidth="w-full", ~bgColor="bg-green-success_page_bg", ~buttonState=Button.Normal, + ~isButtonVisible=true, ) => {

{statusText->React.string}

-
} } diff --git a/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res b/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res index 8779bcedf..8037916c9 100644 --- a/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res +++ b/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res @@ -173,7 +173,7 @@ let make = (~selectedConnector, ~pageView, ~setPageView, ~setConnectorID) => { ~values, ~connector=connectorName, ~bodyType, - ~isLiveMode={featureFlagDetails.testLiveMode}, + ~isLiveMode={featureFlagDetails.isLiveMode}, (), ) @@ -238,7 +238,7 @@ let make = (~selectedConnector, ~pageView, ~setPageView, ~setConnectorID) => { ~connector={connectorName}, ~bodyType, ~isPayoutFlow=false, - ~isLiveMode={featureFlagDetails.testLiveMode}, + ~isLiveMode={featureFlagDetails.isLiveMode}, (), )->ignoreFields(connectorID, verifyConnectorIgnoreField) diff --git a/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthScreen.res b/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthScreen.res index ade1b4c48..ab716ea83 100644 --- a/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthScreen.res +++ b/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthScreen.res @@ -47,7 +47,7 @@ let make = (~setAuthStatus: HyperSwitchAuthTypes.authStatus => unit) => { open HyperSwitchAuthTypes let url = RescriptReactRouter.useUrl() let (mode, setMode) = React.useState(_ => TestButtonMode) - let {testLiveMode, magicLink: isMagicLinkEnabled} = + let {isLiveMode, magicLink: isMagicLinkEnabled} = HyperswitchAtom.featureFlagAtom ->Recoil.useRecoilValueFromAtom ->LogicUtils.safeParse @@ -74,7 +74,7 @@ let make = (~setAuthStatus: HyperSwitchAuthTypes.authStatus => unit) => { }, [isMagicLinkEnabled]) React.useEffect1(() => { - if testLiveMode { + if isLiveMode { setMode(_ => LiveButtonMode) } else { setMode(_ => TestButtonMode) diff --git a/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res b/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res index 00456710d..316a94ab1 100644 --- a/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res +++ b/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res @@ -310,7 +310,7 @@ module Header = { @react.component let make = (~authType, ~setAuthType, ~email) => { let form = ReactFinalForm.useForm() - let {magicLink: isMagicLinkEnabled, testLiveMode} = + let {magicLink: isMagicLinkEnabled, isLiveMode} = HyperswitchAtom.featureFlagAtom ->Recoil.useRecoilValueFromAtom ->LogicUtils.safeParse @@ -383,7 +383,7 @@ module Header = {

{cardHeaderText->React.string}

{switch authType { | LoginWithPassword | LoginWithEmail => - !testLiveMode + !isLiveMode ? getHeaderLink( ~prefix="New to Hyperswitch?", ~authType=SignUP,