diff --git a/StripePaymentSheet/StripePaymentSheet/Resources/Localizations/en.lproj/Localizable.strings b/StripePaymentSheet/StripePaymentSheet/Resources/Localizations/en.lproj/Localizable.strings index 4e0de70147f..d987e714fa0 100644 --- a/StripePaymentSheet/StripePaymentSheet/Resources/Localizations/en.lproj/Localizable.strings +++ b/StripePaymentSheet/StripePaymentSheet/Resources/Localizations/en.lproj/Localizable.strings @@ -188,6 +188,9 @@ re-entering the security code (CVV/CVC). */ /* Title shown above a view containing the customer's card that they can delete or update */ "Manage card" = "Manage card"; +/* Title shown above a view containing a list of the customer's cards that they can delete or update */ +"Manage cards" = "Manage cards"; + /* Title shown above a view containing the customer's payment method that they can delete or update */ "Manage payment method" = "Manage payment method"; diff --git a/StripePaymentSheet/StripePaymentSheet/Source/Categories/String+Localized.swift b/StripePaymentSheet/StripePaymentSheet/Source/Categories/String+Localized.swift index b7bb608074f..27830bccbd0 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/Categories/String+Localized.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/Categories/String+Localized.swift @@ -98,6 +98,13 @@ extension String.Localized { ) } + static var manage_cards: String { + STPLocalizedString( + "Manage cards", + "Title shown above a view containing a list of the customer's cards that they can delete or update" + ) + } + static var bank_account_details_cannot_be_changed: String { STPLocalizedString( "Bank account details cannot be changed.", diff --git a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift index e19e2d5c41d..24c69092b8e 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift @@ -70,12 +70,15 @@ class VerticalSavedPaymentMethodsViewController: UIViewController { } private var headerText: String { + let nonCardPaymentMethods = paymentMethods.filter({ $0.type != .card }) + let hasOnlyCards = nonCardPaymentMethods.isEmpty if isEditingPaymentMethods { + if hasOnlyCards { + return paymentMethods.count == 1 ? .Localized.manage_card : .Localized.manage_cards + } return paymentMethods.count == 1 ? .Localized.manage_payment_method : .Localized.manage_payment_methods } - - let nonCardPaymentMethods = paymentMethods.filter({ $0.type != .card }) - return nonCardPaymentMethods.isEmpty ? .Localized.select_card : .Localized.select_payment_method + return hasOnlyCards ? .Localized.select_card : .Localized.select_payment_method } var canRemovePaymentMethods: Bool {