New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 723294 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

[Payments] Desktop: Improve validation of phone numbers

Project Member Reported by zkoch@chromium.org, May 17 2017

Issue description

See screenshot. I have full address information filled out, including phone information, but an error is still present.
 
Screen Shot 2017-05-16 at 9.32.32 PM.png
185 KB View Download
Cc: anthonyvd@chromium.org
Owner: ma...@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by ma...@chromium.org, May 17 2017

Cc: zkoch@chromium.org
Owner: se...@chromium.org
Summary: [Payments] Desktop: Improve validation of phone numbers (was: PR Non-us countries show information required when all present)
(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.
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
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.)

Comment 5 by mad@chromium.org, May 17 2017

I just fixed a couple of issues related to country and phone numbers on desktop. CL is in CQ...

Comment 6 by se...@chromium.org, May 18 2017

Cc: tmartino@chromium.org mad@chromium.org
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?
e.g.: 514 555 1234 would not work for an Australian profile, but +1 514 555 1234 would

Comment 8 by mad@chromium.org, 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).

Comment 9 by se...@chromium.org, 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.
Cc: rouslan@chromium.org
 Issue 725581  has been merged into this issue.
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:
Screenshot from 2017-05-23 15:24:48.png
25.3 KB View Download

Comment 13 by se...@chromium.org, 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 :)

Comment 15 by se...@chromium.org, May 29 2017

Labels: Merge-Request-60

Comment 16 by se...@chromium.org, May 30 2017

Status: Started (was: Assigned)
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.
Project Member

Comment 17 by sheriffbot@chromium.org, May 30 2017

Labels: -Merge-Request-60 Hotlist-Merge-Approved Merge-Approved-60
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
Project Member

Comment 18 by bugdroid1@chromium.org, May 31 2017

Labels: -merge-approved-60 merge-merged-3112
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

Comment 19 by se...@chromium.org, May 31 2017

Status: Fixed (was: Started)
Cc: sureshkumari@chromium.org
Labels: Needs-Feedback
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.
723294.mov
9.2 MB Download
Seb, please provide the instructions to verify the fix.
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!

Components: -UI>Browser>Autofill>Payments UI>Browser>Payments

Sign in to add a comment