Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5185)

Unified Diff: components/payments/core/payments_profile_comparator.cc

Issue 2911973002: [Payments] Don't show error for intl phone from other country. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/payments/core/payment_request_data_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/core/payments_profile_comparator.cc
diff --git a/components/payments/core/payments_profile_comparator.cc b/components/payments/core/payments_profile_comparator.cc
index e29576236aa5f4b7a986e4e464174059018ea043..3190bacf2a936b0e1087de751638464ddb732791 100644
--- a/components/payments/core/payments_profile_comparator.cc
+++ b/components/payments/core/payments_profile_comparator.cc
@@ -207,7 +207,9 @@ PaymentsProfileComparator::ComputeMissingFields(
base::string16 phone = profile.GetInfo(
autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER), app_locale());
- if (!autofill::IsValidPhoneNumber(phone, country))
+ base::string16 intl_phone = base::UTF8ToUTF16("+" + base::UTF16ToUTF8(phone));
+ if (!(autofill::IsValidPhoneNumber(phone, country) ||
tmartino 2017/05/30 21:52:57 We should keep this consistent with what we do in
sebsg 2017/05/31 14:20:35 Yep, it should already be the case. I modified the
tmartino 2017/05/31 14:48:14 So basically are you saying the + is always passed
sebsg 2017/05/31 17:50:25 Not necessarily. Here is the distinction When we
+ autofill::IsValidPhoneNumber(intl_phone, country)))
missing |= kPhone;
base::string16 email = profile.GetInfo(
« no previous file with comments | « components/payments/core/payment_request_data_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698