OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PaymentsValidators_h | 5 #ifndef PaymentsValidators_h |
6 #define PaymentsValidators_h | 6 #define PaymentsValidators_h |
7 | 7 |
8 #include "components/payments/mojom/payment_request.mojom-blink.h" | 8 #include "components/payments/mojom/payment_request.mojom-blink.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "platform/wtf/Allocator.h" | 10 #include "platform/wtf/Allocator.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // defined by [[ISO4217]], however any string of at most 2048 characters is | 23 // defined by [[ISO4217]], however any string of at most 2048 characters is |
24 // considered valid in other currencySystem. Returns false if currency |code| | 24 // considered valid in other currencySystem. Returns false if currency |code| |
25 // is too long (greater than 2048). | 25 // is too long (greater than 2048). |
26 static bool IsValidCurrencyCodeFormat(const String& code, | 26 static bool IsValidCurrencyCodeFormat(const String& code, |
27 const String& system, | 27 const String& system, |
28 String* optional_error_message); | 28 String* optional_error_message); |
29 | 29 |
30 // Returns true if |amount| is a valid currency code as defined in ISO 20022 | 30 // Returns true if |amount| is a valid currency code as defined in ISO 20022 |
31 // CurrencyAnd30Amount. | 31 // CurrencyAnd30Amount. |
32 static bool IsValidAmountFormat(const String& amount, | 32 static bool IsValidAmountFormat(const String& amount, |
| 33 const String& item_name, |
33 String* optional_error_message); | 34 String* optional_error_message); |
34 | 35 |
35 // Returns true if |code| is a valid ISO 3166 country code. | 36 // Returns true if |code| is a valid ISO 3166 country code. |
36 static bool IsValidCountryCodeFormat(const String& code, | 37 static bool IsValidCountryCodeFormat(const String& code, |
37 String* optional_error_message); | 38 String* optional_error_message); |
38 | 39 |
39 // Returns true if |code| is a valid ISO 639 language code. | 40 // Returns true if |code| is a valid ISO 639 language code. |
40 static bool IsValidLanguageCodeFormat(const String& code, | 41 static bool IsValidLanguageCodeFormat(const String& code, |
41 String* optional_error_message); | 42 String* optional_error_message); |
42 | 43 |
(...skipping 11 matching lines...) Expand all Loading... |
54 String* optional_error_message); | 55 String* optional_error_message); |
55 | 56 |
56 // Returns false if |error| is too long (greater than 2048). | 57 // Returns false if |error| is too long (greater than 2048). |
57 static bool IsValidErrorMsgFormat(const String& code, | 58 static bool IsValidErrorMsgFormat(const String& code, |
58 String* optional_error_message); | 59 String* optional_error_message); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace blink | 62 } // namespace blink |
62 | 63 |
63 #endif // PaymentsValidators_h | 64 #endif // PaymentsValidators_h |
OLD | NEW |