Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAutofill Credit Card section could benefit from validation (length, content, etc) #3370
Comments
|
cc: @darkdh |
|
Could you separate the editing issue and update it to #3368? It's the same root cause and it might be better to leave field length issue here. Thanks. |
|
Done |
|
Perhaps we could concern ourselves with validating the number and tie the activation of the save control to a positive result? |
|
@alexwykoff The validation would be a nice touch |
|
maybe move this into a general data validation ticket for another release? Chrome doesn't do any validation and I can enter letters into the CC field if I want |
|
Updated title- this would be a great one to hear input from @bradleyrichter This is a potential opportunity to give us an advantage over other browsers by performing validation and catching user errors with the information provided Besides length check, we can also consider the approach @alexwykoff has mentioned of not allowing to save input (or giving a warning maybe) if the input doesn't pass a validation test. If we did that some questions:
More information which can be used for validation can be found here: Maybe as a separate issue, we can alert folks on the Autofill screen if their card is nearing (or has passed) expiration |
|
I think it's a good idea, just wanted to move out of 0.11.6 |
|
Totally agree- Since milestone was removed, I closed #3377 and will put the details in the post above |
|
Checkbox idea is good here since we don't yet know of reasons why validation may be problematic. [x] "validate card number as I type" Regarding improvements over the competition, (thanks @bsclifton ) how about showing the user which sites contain the expiring credit card number ahead of time so they can update them all with a low pain threshold before auto-payments fail? (assuming this is not a privacy concern.) |
|
@srirambv great suggestion! I'm not sure if there are legal requirements around the logo and how it's displayed, but showing a logo is possible for sure cc: @bradleyrichter |
|
Actually I'm pretty sure those are already available from the auto fill client and we just need to use them
|
|
I would love to tackle this! |
|
When I was trying to reproduce the issue, I noticed the following: So I have been looking into the code to see where we are adding the credit card and I found something interesting. I suppose that the following function is the one which executes when we don't have any credit card and we want to add one: browser-laptop/js/about/autofill.js Line 150 in 5143bd3 and we are calling it right here: browser-laptop/js/about/autofill.js Line 234 in 5143bd3 However, I am not sure where do we actually save the credit card. Cause once I add it, it seems like the following get's executed too: browser-laptop/js/about/autofill.js Line 85 in 5143bd3 So I am not quite sure where to do the validation. But as I understand that's where we saving the credit card: browser-laptop/js/actions/appActions.js Line 662 in 5143bd3 |
|
@MargarytaChepiga one approach could be to disable the save button until the number provided is valid. You could then run validation on keydown / keyup for the text field (and also with expiration) In that same code, if you have enough to detect which type of card it is (ex: it's valid and starts with 4, it's a VISA) you could then consider showing an icon next to it. As soon as the field becomes invalid, hide any icon Another approach might be to look for an existing credit card React component that we can integrate with (something which may be on npm). We'd need to open a security review either way before accepting this, but it might be that someone has already solved this problem and has support for cards used internationally |
|
Thank you so much @bsclifton for clarifying things for me! I also looked up for some React components, some of them are really cool and it looks like we could consider using them. Please take a look at these ones, and let me know what you think:
|
…e credit card types. Fixes brave#3370
|
I feel safe saying that we won't be able to address this with browser-laptop. Closing as |










Did you search for similar issues before submitting this one?
Yes
Describe the issue you encountered:
Credit Card field should not take more than standard 19 characters. No check done for only numeric values.
Expected behavior:
Should only accept numbers and max length should be 19.
Windows 10 x64
0.11.6 Beta 3