| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_ |
| 6 #define COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/payments/payment_request.mojom.h" |
| 11 |
| 12 namespace payments { |
| 13 |
| 14 class PaymentsValidators { |
| 15 public: |
| 16 // The most common identifiers are three-letter alphabetic codes as |
| 17 // defined by [ISO4217] (for example, "USD" for US Dollars). |system| is |
| 18 // a URL that indicates the currency system that the currency identifier |
| 19 // belongs to. By default, the value is urn:iso:std:iso:4217 indicating |
| 20 // that currency is defined by [[ISO4217]], however any string of at most |
| 21 // 2048 characters is considered valid in other currencySystem. Returns |
| 22 // false if currency |code| is too long (greater than 2048). |
| 23 static bool isValidCurrencyCodeFormat(const std::string& code, |
| 24 const std::string& system, |
| 25 std::string* optionalErrorMessage); |
| 26 |
| 27 // Returns true if |amount| is a valid currency code as defined in ISO 20022 |
| 28 // CurrencyAnd30Amount. |
| 29 static bool isValidAmountFormat(const std::string& amount, |
| 30 std::string* optionalErrorMessage); |
| 31 }; |
| 32 |
| 33 } // namespace payments |
| 34 |
| 35 #endif // COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_ |
| OLD | NEW |