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

Unified Diff: ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm

Issue 2963163002: [Payment Request] Displays accepted card types (credit, debit, etc) in iOS (Closed)
Patch Set: Addressed comments Created 3 years, 6 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/ui/payments/payment_method_selection_mediator.mm
diff --git a/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm b/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm
index 064fc62ac88d697ab3f2e53892113458cad55031..4513447e28888b9744d9c90395e12104a66e23dc 100644
--- a/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm
+++ b/ios/chrome/browser/ui/payments/payment_method_selection_mediator.mm
@@ -6,11 +6,13 @@
#import "ios/chrome/browser/ui/payments/payment_method_selection_mediator.h"
+#include "base/strings/string16.h"
#include "base/strings/sys_string_conversions.h"
#include "components/autofill/core/browser/autofill_data_util.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
+#include "components/payments/core/strings_util.h"
#include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/payments/payment_request.h"
#include "ios/chrome/browser/payments/payment_request_util.h"
@@ -64,7 +66,14 @@ using ::payment_request_util::GetBillingAddressLabelFromAutofillProfile;
}
- (CollectionViewItem*)headerItem {
- return nil;
+ base::string16 headerText = payments::GetCardTypesAreAcceptedText(
+ _paymentRequest->supported_card_types_set());
+ if (headerText.empty())
+ return nil;
+
+ PaymentsTextItem* headerItem = [[PaymentsTextItem alloc] init];
+ headerItem.text = base::SysUTF16ToNSString(headerText);
+ return headerItem;
}
- (NSArray<CollectionViewItem*>*)selectableItems {

Powered by Google App Engine
This is Rietveld 408576698