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

Unified Diff: components/payments/content/payment_request_state.cc

Issue 2779453002: [Payments] Return the preferred payment method name to the merchant (Closed)
Patch Set: compile fix Created 3 years, 9 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: components/payments/content/payment_request_state.cc
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc
index f727b09e80f77e3445789fb1da7b51048cb383db..f2a6ba01d827351d8ebdd268d7fc2c1263dfc46b 100644
--- a/components/payments/content/payment_request_state.cc
+++ b/components/payments/content/payment_request_state.cc
@@ -63,7 +63,13 @@ void PaymentRequestState::OnInstrumentDetailsReady(
// TODO(mathp): Fill other fields in the PaymentResponsePtr object.
mojom::PaymentResponsePtr payment_response = mojom::PaymentResponse::New();
- payment_response->method_name = method_name;
+ // Make sure that we return the method name that the merchant specified for
+ // this instrument: cards can be either specified through their name (e.g.,
+ // "visa") or through basic-card's supportedNetworks.
+ payment_response->method_name =
+ spec_->IsMethodSupportedThroughBasicCard(method_name)
+ ? kBasicCardMethodName
+ : method_name;
payment_response->stringified_details = stringified_details;
delegate_->OnPaymentResponseAvailable(std::move(payment_response));
}

Powered by Google App Engine
This is Rietveld 408576698