| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. Returns true on success, false on | 47 // "basic-card" in the PaymentResponse. Returns true on success, false on |
| 48 // invalid data specified. |method_data.supported_networks| is expected to only | 48 // invalid data specified. |method_data.supported_networks| is expected to only |
| 49 // contain basic-card card network names (the list is at | 49 // contain basic-card card network names (the list is at |
| 50 // https://www.w3.org/Payments/card-network-ids). | 50 // https://www.w3.org/Payments/card-network-ids). |
| 51 bool ParseBasicCardSupportedNetworks( | 51 bool ParseBasicCardSupportedNetworks( |
| 52 const std::vector<PaymentMethodData>& method_data, | 52 const std::vector<PaymentMethodData>& method_data, |
| 53 std::vector<std::string>* out_supported_networks, | 53 std::vector<std::string>* out_supported_networks, |
| 54 std::set<std::string>* out_basic_card_supported_networks); | 54 std::set<std::string>* out_basic_card_supported_networks); |
| 55 | 55 |
| 56 // Formats the given number |phone_number| to |
| 57 // i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL format |
| 58 // by using i18n::phonenumbers::PhoneNumberUtil::Format. |
| 59 std::string FormatPhoneForDisplay(const std::string& phone_number, |
| 60 const std::string& country_code); |
| 61 |
| 62 // Formats the given number |phone_number| to |
| 63 // i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::E164 format by using |
| 64 // i18n::phonenumbers::PhoneNumberUtil::Format, as defined in the Payment |
| 65 // Request spec |
| 66 // (https://w3c.github.io/browser-payment-api/#paymentrequest-updated-algorithm) |
| 67 std::string FormatPhoneForResponse(const std::string& phone_number, |
| 68 const std::string& country_code); |
| 69 |
| 56 } // namespace data_util | 70 } // namespace data_util |
| 57 } // namespace payments | 71 } // namespace payments |
| 58 | 72 |
| 59 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ | 73 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ |
| OLD | NEW |