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

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

Issue 2803543005: [Payments] iOS: Support basic-card (Closed)
Patch Set: addressed comments 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_coordinator.mm
diff --git a/ios/chrome/browser/payments/payment_request_coordinator.mm b/ios/chrome/browser/payments/payment_request_coordinator.mm
index 3290959b01859fee64ef3608d2719302726e50a3..38ecb76fd659b6f5616849bdd114e322ef8a1aeb 100644
--- a/ios/chrome/browser/payments/payment_request_coordinator.mm
+++ b/ios/chrome/browser/payments/payment_request_coordinator.mm
@@ -208,9 +208,17 @@ class FullCardRequester
CVC:(const base::string16&)cvc {
web::PaymentResponse paymentResponse;
+ // If the merchant specified the card network as part of the "basic-card"
+ // payment method, return "basic-card" as the method_name. Otherwise, return
+ // the name of the network directly.
+ std::string basic_card_type =
+ autofill::data_util::GetPaymentRequestData(card.type())
+ .basic_card_payment_type;
paymentResponse.method_name =
- base::ASCIIToUTF16(autofill::data_util::GetPaymentRequestData(card.type())
- .basic_card_payment_type);
+ _paymentRequest->basic_card_specified_networks().find(basic_card_type) !=
+ _paymentRequest->basic_card_specified_networks().end()
+ ? base::ASCIIToUTF16("basic-card")
+ : base::ASCIIToUTF16(basic_card_type);
paymentResponse.details = GetBasicCardResponseFromAutofillCreditCard(
card, cvc, _paymentRequest->billing_profiles(),
« no previous file with comments | « ios/chrome/browser/payments/payment_request.mm ('k') | ios/chrome/browser/payments/payment_request_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698