[CP Staging] Fix postcode validation for add payment card flow#55812
Conversation
|
|
||
| if (values.addressZipCode && !ValidationUtils.isValidZipCode(values.addressZipCode)) { | ||
| errors.addressZipCode = translate('bankAccount.error.zipCode'); | ||
| // If tempered with, this can block users from adding payment cards so |
There was a problem hiding this comment.
♻️ The comment addition was requested here.
|
Oh |
Reviewer Checklist
Screenshots/VideosAndroid: NativeNA iOS: NativeNA |
| }); | ||
| }); | ||
|
|
||
| describe('isValidPaymentZipCode', () => { |
|
@ZhenjaHorbach not sure, but I don't think we need to validate that. |
|
@ZhenjaHorbach I don't think that's an issue, if you check the context mentioned in my proposal, when I removed the validation months ago in the first issue we decided to remove it entirely and leave it to the user to input the postcode correctly. The current issue which this PR fixes is the fact after some recent changes which added back the old validation method, that was only allowing US based post codes, blocking any UK / AU / NZ based postcodes which would confuse users when trying to add cards for subscription payment with postcodes other than US. |
Got it |
|
LGTM ! |
…eValidation [CP Staging] Fix postcode validation for add payment card flow (cherry picked from commit 6c52815) (CP triggered by luacmartins)
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/luacmartins in version: 9.0.89-8 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.89-8 🚀
|



























Explanation of Change
♻️ We're fixing the postcode validation for the Subscription > Add payment card flow to allow users to add postcodes other than US based since they are currently restricted to US based only and can't add payment cards for their subscriptions.
More context in the proposal linked below.
Fixed Issues
$ #55493
PROPOSAL: #55493 (comment)
Tests
Precondition: Create at least 1 workspace to have the Subscription section show up in Settings.
Add payment card.90000or90000-1234or90000 1234(US based, incl. space / hyphen) ✅AB1 2CDorAB12 3CDorAB12CD(UK based, incl. space) ✅4 digit format like
3000(AU / NZ based) ✅any other special characters (
@ , : ; ' " &) should not pass postcode validation ❌Verify that no errors appear in the JS console
Offline tests
Same as Tests.
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.web.mov
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop