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

Fix logic for when editing is available for update #4676

Merged
merged 5 commits into from
Mar 18, 2025
Merged

Conversation

wooj-stripe
Copy link
Collaborator

@wooj-stripe wooj-stripe commented Mar 17, 2025

Summary

Allows users who have integrated with CustomerSessions to update cards if they have paymentmethodRemove || paymentmethodDefault set to disabled.

Motivation

Currently updating cards is only available if you enable paymentMethodDefault or paymentmethodRemove.

Testing

updated existing tests and manually tested

Changelog

@wooj-stripe wooj-stripe marked this pull request as ready for review March 17, 2025 23:29
@wooj-stripe wooj-stripe requested review from a team as code owners March 17, 2025 23:29
$0.isCoBrandedCard && cbcEligible
})
default:
return configuration.paymentMethodRemove || viewModels.contains(where: {
return configuration.paymentMethodRemove || configuration.paymentMethodUpdate || configuration.paymentMethodSyncDefault || viewModels.contains(where: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we forgot to add paymentMethodSyncDefault here, so adding it in addition to paymentMethodUpdate

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CustomerSheet is actually a special case— paymentMethodSyncDefault is not a factor in whether a pm can be edited in CustomerSheet because we don't show a default checkbox. For CustomerSheet, we set it as default when a payment method is selected and confirmed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Right!!! Oops. Will change that back! Thanks for catching.

@wooj-stripe wooj-stripe changed the title Updates the logic for when editing is available for update & defaulting Fix logic for when editing is available for update & defaulting Mar 17, 2025
@wooj-stripe wooj-stripe changed the title Fix logic for when editing is available for update & defaulting Fix logic for when editing is available for update Mar 17, 2025
Copy link
Collaborator

@porter-stripe porter-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@wooj-stripe wooj-stripe merged commit 0460327 into master Mar 18, 2025
6 checks passed
@wooj-stripe wooj-stripe deleted the wooj/fixEditSPM branch March 18, 2025 15:49
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.

3 participants