New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prototype for enable/disable removal of spms #3577
Conversation
Example/PaymentSheet Example/PaymentSheetUITest/CustomerSheetUITest.swift
Outdated
Show resolved
Hide resolved
.../Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift
Outdated
Show resolved
Hide resolved
...Sheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentMethodCollectionView.swift
Outdated
Show resolved
Hide resolved
...heet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift
Outdated
Show resolved
Hide resolved
…ITest.swift Co-authored-by: Yuki <yuki@stripe.com>
...heet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift
Outdated
Show resolved
Hide resolved
@@ -92,9 +92,9 @@ class SavedPaymentOptionsViewController: UIViewController { | |||
return false | |||
case 1: | |||
// If there's exactly one PM, customer can only edit if configuration allows removal or if that single PM allows for the card brand choice to be updated. | |||
return paymentSheetConfiguration.paymentMethodRemove && (configuration.allowsRemovalOfLastSavedPaymentMethod || viewModels.contains(where: { | |||
return (paymentSheetConfiguration.paymentMethodRemove && configuration.allowsRemovalOfLastSavedPaymentMethod) || viewModels.contains(where: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like ideally we unit test canEditPaymentMethods
instead of testing via UI test. That way we can test that various combos of paymentMethodRemove, allowsRemovalOfLastSavedPaymentMethod, and PMs produce the right value. Feel free to ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a ticket. will be done as part of the CustomerSessions work stream.
Summary
Prototyping code under config flag to enable/disable payment method removal
Motivation
Implemented as a client side flag, which will eventually be on CustomerSession
Testing
Added ui tests