| Index: components/payments/payments_validators.h
|
| diff --git a/components/payments/payments_validators.h b/components/payments/payments_validators.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4a0ae32bf3e043eaa1bdfee30c9c9485e05b1299
|
| --- /dev/null
|
| +++ b/components/payments/payments_validators.h
|
| @@ -0,0 +1,35 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_
|
| +#define COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "components/payments/payment_request.mojom.h"
|
| +
|
| +namespace payments {
|
| +
|
| +class PaymentsValidators {
|
| + public:
|
| + // The most common identifiers are three-letter alphabetic codes as
|
| + // defined by [ISO4217] (for example, "USD" for US Dollars). |system| is
|
| + // a URL that indicates the currency system that the currency identifier
|
| + // belongs to. By default, the value is urn:iso:std:iso:4217 indicating
|
| + // that currency is defined by [[ISO4217]], however any string of at most
|
| + // 2048 characters is considered valid in other currencySystem. Returns
|
| + // false if currency |code| is too long (greater than 2048).
|
| + static bool isValidCurrencyCodeFormat(const std::string& code,
|
| + const std::string& system,
|
| + std::string* optionalErrorMessage);
|
| +
|
| + // Returns true if |amount| is a valid currency code as defined in ISO 20022
|
| + // CurrencyAnd30Amount.
|
| + static bool isValidAmountFormat(const std::string& amount,
|
| + std::string* optionalErrorMessage);
|
| +};
|
| +
|
| +} // namespace payments
|
| +
|
| +#endif // COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_
|
|
|