-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[CP Staging] Fix postcode validation for add payment card flow #55812
[CP Staging] Fix postcode validation for add payment card flow #55812
Conversation
errors.addressStreet = translate(label.error.addressStreet); | ||
} | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
♻️ The comment addition was requested here.
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.
LGTM
Oh |
Reviewer Checklist
Screenshots/VideosAndroid: NativeNA iOS: NativeNA |
}); | ||
}); | ||
|
||
describe('isValidPaymentZipCode', () => { |
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.
Thanks for tests
@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
.90000
or90000-1234
or90000 1234
(US based, incl. space / hyphen) ✅AB1 2CD
orAB12 3CD
orAB12CD
(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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.web.mov
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop