[Payments] Desktop: Improve validation of phone numbers |
||||||||||
Issue descriptionSee screenshot. I have full address information filled out, including phone information, but an error is still present.
,
May 17 2017
(1) String should not say Phone number required if there is a phone number. Should make the distinction missing vs required (2) Phone number validation should be according to the country that's being entered, not the application locale.
,
May 17 2017
More specifically to c#2, the intended behavior should be: 1. Always allow international format 2. Validate according to local format for the profile country, if there is one 3. Validate according to local format for the locale, if there is no profile country
,
May 17 2017
When in the address editor, validate according to the country in the dropdown. (I'm not sure whether that dropdown updates the profile's country immediately.)
,
May 17 2017
I just fixed a couple of issues related to country and phone numbers on desktop. CL is in CQ...
,
May 18 2017
Mad@ is your CL in? I think Math's point 1 still needs to be done. We should say "invalid phone number" instead of "missing phone number" tmartino@ when you say always allow international format, do you mean of any country or only the country of the profile?
,
May 18 2017
e.g.: 514 555 1234 would not work for an Australian profile, but +1 514 555 1234 would
,
May 18 2017
The CL for phone number / countries issue was committed this morning: https://chromium.googlesource.com/chromium/src/+/09f15955329247e16c8547119e326ac8f35a269c And the message used for invalid phone numbers is: "Enter a valid phone number" (https://cs.chromium.org/chromium/src/components/payments_strings.grdp?type=cs&q=IDS_PAYMENTS_PHONE_INVALID_VALIDATION_MESSAGE+package:%5Echromium$&l=170).
,
May 23 2017
Ok here is what I found: A local phone number is always accepted (from the currently selected country) An international phone number is also always accepted BUT it needs the "+" at the front. Now the problem is that we don't save the + in the phone number. So what happens is you fill an international phone with a + and it passes validation. The + is then removed before saving. So the phone number is set to be invalid right after.
,
May 23 2017
Found the culprit, When formatting the "+" is removed for US and CA: https://cs.chromium.org/chromium/src/components/autofill/core/browser/phone_number_i18n.cc?q=phone_number_&sq=package:chromium&dr=C&l=71-80
,
May 23 2017
,
May 23 2017
FYI, we *do* save the "+" on disk. So removing "+" happens after the data is read from disk, not before it's written. See the screenshot of my data on disk:
,
May 24 2017
Per comment 12, it seems we now do always save the "+" thanks to your formatting. Since you add some "-" in the number. If the number only had numbers and "+" it would formatted to remove the "+". Thanks for your patch it makes it simpler :)
,
May 29 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1c933fe531736aaa2c98f160c4c4e810858a6407 commit 1c933fe531736aaa2c98f160c4c4e810858a6407 Author: sebsg <sebsg@chromium.org> Date: Mon May 29 21:24:49 2017 [Payments] Allow international phone from different country in shipping editor. BUG= 723294 Review-Url: https://codereview.chromium.org/2905283002 Cr-Commit-Position: refs/heads/master@{#475383} [modify] https://crrev.com/1c933fe531736aaa2c98f160c4c4e810858a6407/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc [modify] https://crrev.com/1c933fe531736aaa2c98f160c4c4e810858a6407/components/payments/core/payment_request_data_util.cc [modify] https://crrev.com/1c933fe531736aaa2c98f160c4c4e810858a6407/components/payments/core/payment_request_data_util_unittest.cc
,
May 29 2017
,
May 30 2017
That CL makes it possible to add an intl phone from another country. I created this one to not show the error label : crbug.com/727432 It'll be easier to merge with 2 different bugs.
,
May 30 2017
Your change meets the bar and is auto-approved for M60. Please go ahead and merge the CL to branch 3112 manually. Please contact milestone owner if you have questions. Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9bbfd2a9bca7cb96f55aa02bcee7b9ca6cf6f670 commit 9bbfd2a9bca7cb96f55aa02bcee7b9ca6cf6f670 Author: sebsg <sebsg@chromium.org> Date: Wed May 31 14:28:50 2017 [Payments] Allow international phone from different country in shipping editor. BUG= 723294 Review-Url: https://codereview.chromium.org/2905283002 Cr-Original-Commit-Position: refs/heads/master@{#475383} Review-Url: https://codereview.chromium.org/2910423003 . Cr-Commit-Position: refs/branch-heads/3112@{#53} Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897} [modify] https://crrev.com/9bbfd2a9bca7cb96f55aa02bcee7b9ca6cf6f670/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc [modify] https://crrev.com/9bbfd2a9bca7cb96f55aa02bcee7b9ca6cf6f670/components/payments/core/payment_request_data_util.cc [modify] https://crrev.com/9bbfd2a9bca7cb96f55aa02bcee7b9ca6cf6f670/components/payments/core/payment_request_data_util_unittest.cc
,
May 31 2017
,
Jun 1 2017
Tested the issue on 60.0.3112.10 on Windows-7, Mac-OS 10.12.4 and Linux Ubuntu-14.04 with the steps mentioned in merged issue 725581 . Please find the attached screen cast and let us know is this the expected behavior? Thanks.
,
Jun 1 2017
Seb, please provide the instructions to verify the fix.
,
Jun 1 2017
To test this fix: Enable the following flags in chrome://flags - Experimental Web Platform feature - Web Payments 1- Navigate to https://rsolomakhin.github.io/pr/single/ 2- Click the "buy" button 3- Add a shipping address: Set the country to something else than US and CA Fill the address but add a phone number from US/CA like +1 415-555-5555 You should be able to save this address. You should also be able to the opposite, an AU international phone number like +61 2 9374 4000 for a profile with the country set to US. Thanks!
,
Jun 27 2017
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by anthonyvd@chromium.org
, May 17 2017Owner: ma...@chromium.org
Status: Assigned (was: Untriaged)