-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: Add Corpay bank info step and update file upload logic #52054
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
Merged
madmax330
merged 12 commits into
Expensify:main
from
callstack-internal:feature/gr-setup-step-2
Nov 14, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0782b6e
feat: Add Corpay bank info step and update file upload logic
pasyukevich cd911d1
feat: update translations, bank number last digits
pasyukevich a2030c4
feat: add upload field to the confirmation screen
pasyukevich 723442e
Merge branch 'main' into feature/gr-setup-step-2
pasyukevich feb5584
feat: update bank info translations and remove redundant confirmation…
pasyukevich 3f07571
fix: text shrinking
pasyukevich df49535
fix: remove redundant fields from mock data
pasyukevich f2cb5a8
fix: update translations
pasyukevich e8a6264
fix: address comments, redirect to bankstatement page
pasyukevich 6d2e652
Merge branch 'main' into feature/gr-setup-step-2
pasyukevich e182f00
fix: lint
pasyukevich 2ccbe73
fix: redirect on confirm
pasyukevich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -343,6 +343,163 @@ function validateBankAccount(bankAccountID: number, validateCode: string, policy | |
| API.write(WRITE_COMMANDS.VALIDATE_BANK_ACCOUNT_WITH_TRANSACTIONS, parameters, onyxData); | ||
| } | ||
|
|
||
| function getCorpayBankAccountFields(country: string, currency: string) { | ||
| // TODO - Use parameters when API is ready | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const parameters = { | ||
| countryISO: country, | ||
| currency, | ||
| isWithdrawal: true, | ||
| isBusinessBankAccount: true, | ||
| }; | ||
|
|
||
| // return API.read(READ_COMMANDS.GET_CORPAY_BANK_ACCOUNT_FIELDS, parameters); | ||
|
Contributor
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. I think the API is ready, but we'll add it in in a the next phase right?
Member
Author
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. Yes, we will do it in the next step |
||
| return { | ||
| bankCountry: 'AU', | ||
| bankCurrency: 'AUD', | ||
| classification: 'Business', | ||
| destinationCountry: 'AU', | ||
| formFields: [ | ||
| { | ||
| errorMessage: 'Swift must be less than 12 characters', | ||
| id: 'swiftBicCode', | ||
| isRequired: false, | ||
| isRequiredInValueSet: true, | ||
| label: 'Swift Code', | ||
| regEx: '^.{0,12}$', | ||
| validationRules: [ | ||
| { | ||
| errorMessage: 'Swift must be less than 12 characters', | ||
| regEx: '^.{0,12}$', | ||
| }, | ||
| { | ||
| errorMessage: 'The following characters are not allowed: <,>, "', | ||
| regEx: '^[^<>\\x22]*$', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| errorMessage: 'Beneficiary Bank Name must be less than 250 characters', | ||
| id: 'bankName', | ||
| isRequired: true, | ||
| isRequiredInValueSet: true, | ||
| label: 'Bank Name', | ||
| regEx: '^.{0,250}$', | ||
| validationRules: [ | ||
| { | ||
| errorMessage: 'Beneficiary Bank Name must be less than 250 characters', | ||
| regEx: '^.{0,250}$', | ||
| }, | ||
| { | ||
| errorMessage: 'The following characters are not allowed: <,>, "', | ||
| regEx: '^[^<>\\x22]*$', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| errorMessage: 'City must be less than 100 characters', | ||
| id: 'bankCity', | ||
| isRequired: true, | ||
| isRequiredInValueSet: true, | ||
| label: 'Bank City', | ||
| regEx: '^.{0,100}$', | ||
| validationRules: [ | ||
| { | ||
| errorMessage: 'City must be less than 100 characters', | ||
| regEx: '^.{0,100}$', | ||
| }, | ||
| { | ||
| errorMessage: 'The following characters are not allowed: <,>, "', | ||
| regEx: '^[^<>\\x22]*$', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| errorMessage: 'Bank Address Line 1 must be less than 1000 characters', | ||
| id: 'bankAddressLine1', | ||
| isRequired: true, | ||
| isRequiredInValueSet: true, | ||
| label: 'Bank Address', | ||
| regEx: '^.{0,1000}$', | ||
| validationRules: [ | ||
| { | ||
| errorMessage: 'Bank Address Line 1 must be less than 1000 characters', | ||
| regEx: '^.{0,1000}$', | ||
| }, | ||
| { | ||
| errorMessage: 'The following characters are not allowed: <,>, "', | ||
| regEx: '^[^<>\\x22]*$', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| detailedRule: [ | ||
| { | ||
| isRequired: true, | ||
| value: [ | ||
| { | ||
| errorMessage: 'Beneficiary Account Number is invalid. Value should be 1 to 50 characters long.', | ||
| regEx: '^.{1,50}$', | ||
| ruleDescription: '1 to 50 characters', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| errorMessage: 'Beneficiary Account Number is invalid. Value should be 1 to 50 characters long.', | ||
| id: 'accountNumber', | ||
| isRequired: true, | ||
| isRequiredInValueSet: true, | ||
| label: 'Account Number (iACH)', | ||
| regEx: '^.{1,50}$', | ||
| validationRules: [ | ||
| { | ||
| errorMessage: 'Beneficiary Account Number is invalid. Value should be 1 to 50 characters long.', | ||
| regEx: '^.{1,50}$', | ||
| ruleDescription: '1 to 50 characters', | ||
| }, | ||
| { | ||
| errorMessage: 'The following characters are not allowed: <,>, "', | ||
| regEx: '^[^<>\\x22]*$', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| detailedRule: [ | ||
| { | ||
| isRequired: true, | ||
| value: [ | ||
| { | ||
| errorMessage: 'BSB Number is invalid. Value should be exactly 6 digits long.', | ||
| regEx: '^[0-9]{6}$', | ||
| ruleDescription: 'Exactly 6 digits', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| errorMessage: 'BSB Number is invalid. Value should be exactly 6 digits long.', | ||
| id: 'routingCode', | ||
| isRequired: true, | ||
| isRequiredInValueSet: true, | ||
| label: 'BSB Number', | ||
| regEx: '^[0-9]{6}$', | ||
| validationRules: [ | ||
| { | ||
| errorMessage: 'BSB Number is invalid. Value should be exactly 6 digits long.', | ||
| regEx: '^[0-9]{6}$', | ||
| ruleDescription: 'Exactly 6 digits', | ||
| }, | ||
| { | ||
| errorMessage: 'The following characters are not allowed: <,>, "', | ||
| regEx: '^[^<>\\x22]*$', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| paymentMethods: ['E'], | ||
| preferredMethod: 'E', | ||
| }; | ||
| } | ||
|
|
||
| function clearReimbursementAccount() { | ||
| Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, null); | ||
| } | ||
|
|
@@ -572,6 +729,7 @@ export { | |
| updateAddPersonalBankAccountDraft, | ||
| clearPersonalBankAccountSetupType, | ||
| validatePlaidSelection, | ||
| getCorpayBankAccountFields, | ||
| }; | ||
|
|
||
| export type {BusinessAddress, PersonalAddress}; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.