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

Unified Diff: ios/chrome/browser/payments/payment_request.mm

Issue 2803543005: [Payments] iOS: Support basic-card (Closed)
Patch Set: Created 3 years, 8 months 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
Index: ios/chrome/browser/payments/payment_request.mm
diff --git a/ios/chrome/browser/payments/payment_request.mm b/ios/chrome/browser/payments/payment_request.mm
index 9af93a43adcf86a143ff5f51aeda91f88ab7a991..74ab610128f7815691398f26c6211a6b0dc84968 100644
--- a/ios/chrome/browser/payments/payment_request.mm
+++ b/ios/chrome/browser/payments/payment_request.mm
@@ -10,6 +10,7 @@
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/payments/core/currency_formatter.h"
+#include "components/payments/core/payment_request_data_util.h"
#include "ios/chrome/browser/application_context.h"
#include "ios/web/public/payments/payment_request.h"
@@ -83,10 +84,12 @@ void PaymentRequest::PopulateProfileCache() {
}
void PaymentRequest::PopulateCreditCardCache() {
- for (const auto& method_data : web_payment_request_.method_data) {
- for (const std::string& supported_method : method_data.supported_methods) {
- supported_card_networks_.push_back(supported_method);
- }
+ if (!payments::data_util::ParseBasicCardSupportedNetworks(
+ web_payment_request_.method_data, &supported_card_networks_,
+ &basic_card_specified_networks_)) {
+ // TODO(crbug.com/709036): close the UI and reject the promise since the
+ // data is invalid.
+ return;
}
const std::vector<autofill::CreditCard*>& credit_cards_to_suggest =

Powered by Google App Engine
This is Rietveld 408576698