Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: components/payments/payments_validators.h

Issue 2373103002: [Web Payments] Common Payments validation (Closed)
Patch Set: Deps 2 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 defined by
17 // [ISO4217] (for example, "USD" for US Dollars)
18 // however any string of at most 2048 characters is considered valid. Returns
19 // false if currency |code| is too long (greater than 2048).
20 static bool isValidCurrencyCodeFormat(const std::string& code,
please use gerrit instead 2016/10/28 18:38:58 This validator now has "system" parameter. https:
Kevin Bailey 2016/10/28 20:53:05 I've added the parameter, but no one added it to t
please use gerrit instead 2016/10/31 13:17:33 SGTM. It's good that we're finding these discrepan
Kevin Bailey 2016/10/31 14:10:03 Done.
21 std::string* optionalErrorMessage);
22
23 // Returns true if |amount| is a valid currency code as defined in ISO 20022
24 // CurrencyAnd30Amount.
25 static bool isValidAmountFormat(const std::string& amount,
26 std::string* optionalErrorMessage);
27 };
28
29 } // namespace payments
30
31 #endif // COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698