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

Side by Side Diff: components/payments/core/payment_request_data_util.h

Issue 2842463002: [Payments] Normalize billing address for response on Desktop. (Closed)
Patch Set: Keep the old version for iOS Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ 5 #ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_
6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ 6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 // profile. 28 // profile.
29 PaymentAddress GetPaymentAddressFromAutofillProfile( 29 PaymentAddress GetPaymentAddressFromAutofillProfile(
30 const autofill::AutofillProfile& profile, 30 const autofill::AutofillProfile& profile,
31 const std::string& app_locale); 31 const std::string& app_locale);
32 32
33 // Helper function to get an instance of web::BasicCardResponse from an autofill 33 // Helper function to get an instance of web::BasicCardResponse from an autofill
34 // credit card. 34 // credit card.
35 BasicCardResponse GetBasicCardResponseFromAutofillCreditCard( 35 BasicCardResponse GetBasicCardResponseFromAutofillCreditCard(
36 const autofill::CreditCard& card, 36 const autofill::CreditCard& card,
37 const base::string16& cvc, 37 const base::string16& cvc,
38 const autofill::AutofillProfile& billing_profile,
39 const std::string& app_locale);
40 // TODO(crbug.com/714655): Once the billing address is checked in the instrument
Mathieu 2017/04/24 19:42:09 not sure I like this fork very much. can you move
sebsg 2017/04/25 17:36:44 Done.
41 // on iOS, remove this.
42 BasicCardResponse GetBasicCardResponseFromAutofillCreditCard(
43 const autofill::CreditCard& card,
44 const base::string16& cvc,
38 const std::vector<autofill::AutofillProfile*>& billing_profiles, 45 const std::vector<autofill::AutofillProfile*>& billing_profiles,
39 const std::string& app_locale); 46 const std::string& app_locale);
40 47
41 // Parse the supported card networks from supportedMethods and "basic-card"'s 48 // Parse the supported card networks from supportedMethods and "basic-card"'s
42 // supportedNetworks. |out_supported_networks| is filled with list of networks 49 // supportedNetworks. |out_supported_networks| is filled with list of networks
43 // in the order that they were specified by the merchant. 50 // in the order that they were specified by the merchant.
44 // |out_basic_card_supported_networks| is a subset of |out_supported_networks| 51 // |out_basic_card_supported_networks| is a subset of |out_supported_networks|
45 // that includes all networks that were specified as part of "basic-card". This 52 // that includes all networks that were specified as part of "basic-card". This
46 // is used to know whether to return the card network name (e.g., "visa") or 53 // is used to know whether to return the card network name (e.g., "visa") or
47 // "basic-card" in the PaymentResponse. |method_data.supported_networks| is 54 // "basic-card" in the PaymentResponse. |method_data.supported_networks| is
(...skipping 15 matching lines...) Expand all
63 // i18n::phonenumbers::PhoneNumberUtil::Format, as defined in the Payment 70 // i18n::phonenumbers::PhoneNumberUtil::Format, as defined in the Payment
64 // Request spec 71 // Request spec
65 // (https://w3c.github.io/browser-payment-api/#paymentrequest-updated-algorithm) 72 // (https://w3c.github.io/browser-payment-api/#paymentrequest-updated-algorithm)
66 std::string FormatPhoneForResponse(const std::string& phone_number, 73 std::string FormatPhoneForResponse(const std::string& phone_number,
67 const std::string& country_code); 74 const std::string& country_code);
68 75
69 } // namespace data_util 76 } // namespace data_util
70 } // namespace payments 77 } // namespace payments
71 78
72 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ 79 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698