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

Unified Diff: components/payments/payment_details_validation.cc

Issue 2470463002: Add data parameter to payment details modifier. (Closed)
Patch Set: Rebase Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/payments/payment_request.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/payment_details_validation.cc
diff --git a/components/payments/payment_details_validation.cc b/components/payments/payment_details_validation.cc
index 08a6fa3dd433f0f8cf3ccb78bc56df90c0f05414..a01303e904cea9bb89f2005d2865de3bf7a3ed24 100644
--- a/components/payments/payment_details_validation.cc
+++ b/components/payments/payment_details_validation.cc
@@ -108,19 +108,15 @@ bool validatePaymentDetailsModifiers(
return false;
}
- std::set<mojo::String> uniqueMethods;
for (const auto& modifier : modifiers) {
- if (modifier->supported_methods.empty()) {
- *error_message = "Must specify at least one payment method identifier";
+ if (!modifier->method_data) {
+ *error_message = "Method data required";
return false;
}
- for (const auto& method : modifier->supported_methods) {
- if (uniqueMethods.find(method) != uniqueMethods.end()) {
- *error_message = "Duplicate payment method identifiers are not allowed";
- return false;
- }
- uniqueMethods.insert(method);
+ if (modifier->method_data->supported_methods.empty()) {
+ *error_message = "Must specify at least one payment method identifier";
+ return false;
}
if (modifier->total) {
« no previous file with comments | « no previous file | components/payments/payment_request.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698