From 97237d9350ac2d679eb8ade169ab622bcd1388fe Mon Sep 17 00:00:00 2001 From: Samran Ahmed Date: Tue, 24 Feb 2026 01:16:46 +0500 Subject: [PATCH 1/2] add mock bank feature for use staging server --- src/pages/workspace/companyCards/addNew/SelectBankStep.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx b/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx index 60e6ed35edf6..105d9aba497d 100644 --- a/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx +++ b/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx @@ -35,6 +35,7 @@ function SelectBankStep() { const {isOffline} = useNetwork(); const [addNewCard] = useOnyx(ONYXKEYS.ADD_NEW_COMPANY_CARD); + const [shouldUseStagingServer = false] = useOnyx(ONYXKEYS.SHOULD_USE_STAGING_SERVER); const [localBankSelected, setLocalBankSelected] = useState | null>(); const bankSelected = localBankSelected ?? addNewCard?.data.selectedBank; const [hasError, setHasError] = useState(false); @@ -66,9 +67,9 @@ function SelectBankStep() { const data = Object.values(CONST.COMPANY_CARDS.BANKS) .filter((bank) => { - // Only show Mock Bank when the frontend environment is not production + // Only show Mock Bank when the frontend environment is not production or when using the staging server if (bank === CONST.COMPANY_CARDS.BANKS.MOCK_BANK) { - return CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION; + return CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION || shouldUseStagingServer; } return true; }) From ebeb0f43e8aaa954cdcd1b734566e94df3373ee5 Mon Sep 17 00:00:00 2001 From: Samran Ahmed Date: Tue, 24 Feb 2026 01:41:02 +0500 Subject: [PATCH 2/2] Update shouldUseStagingServer to use isUsingStagingApi as default --- src/pages/workspace/companyCards/addNew/SelectBankStep.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx b/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx index 105d9aba497d..01dbbbc669b2 100644 --- a/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx +++ b/src/pages/workspace/companyCards/addNew/SelectBankStep.tsx @@ -15,6 +15,7 @@ import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; import useThemeIllustrations from '@hooks/useThemeIllustrations'; import useThemeStyles from '@hooks/useThemeStyles'; +import {isUsingStagingApi} from '@libs/ApiUtils'; import {getBankCardDetailsImage, getCorrectStepForPlaidSelectedBank} from '@libs/CardUtils'; import Navigation from '@navigation/Navigation'; import type {PlatformStackRouteProp} from '@navigation/PlatformStackNavigation/types'; @@ -35,7 +36,7 @@ function SelectBankStep() { const {isOffline} = useNetwork(); const [addNewCard] = useOnyx(ONYXKEYS.ADD_NEW_COMPANY_CARD); - const [shouldUseStagingServer = false] = useOnyx(ONYXKEYS.SHOULD_USE_STAGING_SERVER); + const [shouldUseStagingServer = isUsingStagingApi()] = useOnyx(ONYXKEYS.SHOULD_USE_STAGING_SERVER); const [localBankSelected, setLocalBankSelected] = useState | null>(); const bankSelected = localBankSelected ?? addNewCard?.data.selectedBank; const [hasError, setHasError] = useState(false);