Skip to content
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

Merged
merged 7 commits into from May 15, 2024
Merged

Conversation

wooj-stripe
Copy link
Collaborator

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

@wooj-stripe wooj-stripe marked this pull request as ready for review May 13, 2024 16:50
@wooj-stripe wooj-stripe requested review from a team as code owners May 13, 2024 16:50
@stripe stripe deleted a comment from github-actions bot May 15, 2024
@@ -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: {
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@wooj-stripe wooj-stripe merged commit 1a9ad18 into master May 15, 2024
4 checks passed
@wooj-stripe wooj-stripe deleted the wooj/rmrm branch May 15, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants