You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PAID] [$250] [Payment card / Subscription] limit input field to 16 digits in add-payment-card screen field for card number #44111
changed the title [-][Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/-][+][$250] [Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/+]on Jun 20, 2024
By this, when we pasted a string with non-digit characters, the input would only keep the digits and we couldn't type non-digit characters as well.
What alternative solutions did you explore? (Optional)
We can optionally format the card number to the space-separated form (i.e. 0123 4567 8910) using the above approach. Additionally, we should write a util function extractCardNumber to extract the plain digits without spaces so the submit handler could use the minified value.
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
[@fedirjh] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@fedirjh] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@fedirjh] Determine if we should create a regression test for this bug.
[@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Determine if we should create a regression test for this bug: Yes
Regression Test Proposal
1. Create a new account
2. Create a workspace on that account
3. Go to /settings/subscription/add-payment-card
4. Click at the card number field and type "abcdef01234567891234567"
5. Verify that the input field should adhere to the following guidelines:
- Only numeric characters should be allowed; alphabet characters are not permitted.
- The input field should be restricted to a maximum of 16 digits.
- Spacing should be added between every 4 digits within the input field.
changed the title [-][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] [Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/-][+][PAID] [$250] [Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/+]on Jul 23, 2024
Activity
melvin-bot commentedon Jun 20, 2024
Triggered auto assignment to @strepanier03 (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.[-][Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/-][+][$250] [Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/+]melvin-bot commentedon Jun 20, 2024
Job added to Upwork: https://www.upwork.com/jobs/~0117d7a6e5f63d9c2e
melvin-bot commentedon Jun 20, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)gijoe0295 commentedon Jun 20, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Alphabet characters should not be allowed into the input field and the input field should be limited to 16 digits
What is the root cause of that problem?
This is a feature request.
What changes do you think we should make in order to solve the problem?
cardNumberstate and use it for the card number input'svalueonValueChangefor card number input where we remove all non-digit characters:maxLength={16}By this, when we pasted a string with non-digit characters, the input would only keep the digits and we couldn't type non-digit characters as well.
What alternative solutions did you explore? (Optional)
We can optionally format the card number to the space-separated form (i.e.
0123 4567 8910) using the above approach. Additionally, we should write a util functionextractCardNumberto extract the plain digits without spaces so the submit handler could use the minified value.42 remaining items
melvin-bot commentedon Jul 15, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
strepanier03 commentedon Jul 17, 2024
@nkdengineer - I've paid and closed the contract in Upwork.
@fedirjh - I'll check tomorrow for the checklist and reg test steps above, then pay when that's completed.
Thank you both!
fedirjh commentedon Jul 22, 2024
BugZero Checklist:
Regression Test Proposal
JmillsExpensify commentedon Jul 22, 2024
@strepanier03 payment summary when you get a chance
melvin-bot commentedon Jul 23, 2024
@strepanier03, @blimpich, @fedirjh, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?
strepanier03 commentedon Jul 23, 2024
Payment Summary
@JmillsExpensify - Request incoming.
[-][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] [Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/-][+][PAID] [$250] [Payment card / Subscription] limit input field to 16 digits in `add-payment-card` screen field for card number[/+]JmillsExpensify commentedon Jul 23, 2024
$250 approved for @fedirjh
strepanier03 commentedon Jul 24, 2024
Looks great, thanks for confirming. Closing this now.