Repository navigation
[HOLD] Refactor payment util to use dynamic verify account #90171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7912147
8ee36d5
ea1aaf5
628da28
42a6783
fd18634
1d4a844
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ import {createWorkspace, generateDefaultWorkspaceName, isCurrencySupportedForDir | |
| import {navigateToBankAccountRoute} from '@libs/actions/ReimbursementAccount'; | ||
| import {getLastPolicyBankAccountID, getLastPolicyPaymentMethod} from '@libs/actions/Search'; | ||
| import {isBankAccountPartiallySetup} from '@libs/BankAccountUtils'; | ||
| import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import {formatPaymentMethods, getActivePaymentType, getBusinessBankAccountOptions, matchesCurrency} from '@libs/PaymentUtils'; | ||
| import {getPolicyEmployeeAccountIDs, isPaidGroupPolicy, isPolicyAdmin, sortPoliciesByName} from '@libs/PolicyUtils'; | ||
|
|
@@ -43,15 +44,15 @@ import { | |
| isInvoiceReport as isInvoiceReportUtil, | ||
| isIOUReport, | ||
| } from '@libs/ReportUtils'; | ||
| import {handleUnvalidatedUserNavigation, useSettlementButtonPaymentMethods} from '@libs/SettlementButtonUtils'; | ||
| import useSettlementButtonPaymentMethods from '@libs/SettlementButtonUtils'; | ||
| import shouldPopoverUseScrollView from '@libs/shouldPopoverUseScrollView'; | ||
| import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils'; | ||
| import {pressLockedBankAccount, setPersonalBankAccountContinueKYCOnSuccess} from '@userActions/BankAccounts'; | ||
| import {approveMoneyRequest} from '@userActions/IOU/ReportWorkflow'; | ||
| import {navigateToConciergeChat} from '@userActions/Report'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES'; | ||
| import type {AccountData, BankAccount, LastPaymentMethodType, Policy} from '@src/types/onyx'; | ||
| import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage'; | ||
| import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||
|
|
@@ -202,7 +203,7 @@ function SettlementButton({ | |
| } | ||
|
|
||
| if (!isUserValidated && paymentMethodType !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE) { | ||
| handleUnvalidatedUserNavigation(chatReportID, reportID); | ||
| Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.VERIFY_ACCOUNT.path)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This new generic navigation also runs for the Useful? React with 👍 / 👎. |
||
| return true; | ||
| } | ||
|
|
||
|
|
@@ -246,8 +247,6 @@ function SettlementButton({ | |
| ownerBillingGracePeriodEnd, | ||
| showDelegateNoAccessModal, | ||
| showLockedAccountModal, | ||
| chatReportID, | ||
| reportID, | ||
| showConfirmModal, | ||
| translate, | ||
| styles.renderHTML, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the unvalidated-user flow is opened from money-request creation tabs,
createDynamicRoute()appendsverify-accountto the active tab URL (for examplecreate/pay/start/.../manual/verify-account). The create flow redirects users directly to these tab URLs inIOURequestRedirectToStartPage, and the linking config parses the tab (manual,distance,scan, etc.) as the focused route underSCREENS.MONEY_REQUEST.CREATE. Since this entry only authorizes the parent create screen,getStateFromPathrejects the dynamic suffix for those tab URLs and the magic-code page will not open from that flow.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand what
codexhas in mind here butSCREENS.MONEY_REQUEST.CREATEseems to be working fine:Screen.Recording.2026-06-09.at.14.01.59.mov