OLD | NEW |
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 Loading... |
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 std::vector<autofill::AutofillProfile*>& billing_profiles, | 38 const autofill::AutofillProfile& billing_profile, |
39 const std::string& app_locale); | 39 const std::string& app_locale); |
40 | 40 |
41 // Parse the supported card networks from supportedMethods and "basic-card"'s | 41 // Parse the supported card networks from supportedMethods and "basic-card"'s |
42 // supportedNetworks. |out_supported_networks| is filled with list of networks | 42 // supportedNetworks. |out_supported_networks| is filled with list of networks |
43 // in the order that they were specified by the merchant. | 43 // in the order that they were specified by the merchant. |
44 // |out_basic_card_supported_networks| is a subset of |out_supported_networks| | 44 // |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 | 45 // 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 | 46 // 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 | 47 // "basic-card" in the PaymentResponse. |method_data.supported_networks| is |
48 // expected to only contain basic-card card network names (the list is at | 48 // expected to only contain basic-card card network names (the list is at |
(...skipping 14 matching lines...) Expand all Loading... |
63 // i18n::phonenumbers::PhoneNumberUtil::Format, as defined in the Payment | 63 // i18n::phonenumbers::PhoneNumberUtil::Format, as defined in the Payment |
64 // Request spec | 64 // Request spec |
65 // (https://w3c.github.io/browser-payment-api/#paymentrequest-updated-algorithm) | 65 // (https://w3c.github.io/browser-payment-api/#paymentrequest-updated-algorithm) |
66 std::string FormatPhoneForResponse(const std::string& phone_number, | 66 std::string FormatPhoneForResponse(const std::string& phone_number, |
67 const std::string& country_code); | 67 const std::string& country_code); |
68 | 68 |
69 } // namespace data_util | 69 } // namespace data_util |
70 } // namespace payments | 70 } // namespace payments |
71 | 71 |
72 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ | 72 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ |
OLD | NEW |