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

Hide default checkbox and auto-set if first #4643

Merged
merged 6 commits into from
Mar 10, 2025

Conversation

joyceqin-stripe
Copy link
Collaborator

@joyceqin-stripe joyceqin-stripe commented Mar 10, 2025

Summary

If a customer has no saved payment methods and the default feature is enabled, hide the default checkbox and automatically set new card or US bank account as the default.

Motivation

Bug bash suggestion

Testing

Updated UI test

Changelog

@joyceqin-stripe joyceqin-stripe marked this pull request as ready for review March 10, 2025 19:58
@joyceqin-stripe joyceqin-stripe requested review from a team as code owners March 10, 2025 19:58
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.

Just a non blocking question

@@ -2854,8 +2852,7 @@ class PaymentSheetDefaultSPMUITests: PaymentSheetUITestCase {
saveThisCardToggle.tap()
XCTAssertTrue(saveThisCardToggle.isSelected)
// do not set this card as default
setDefaultToggle = app.switches["Set as default payment method"]
XCTAssertFalse(setDefaultToggle.isSelected)
XCTAssertFalse(app.switches["Set as default payment method"].isSelected)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this? Is the "Set as default payment method" even visible?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We previously saved a card, so the "Set as default payment method" checkbox is shown when we try adding another card. Since the new card wouldn't be the only saved payment method, it wouldn't automatically be set as the default.

@joyceqin-stripe joyceqin-stripe merged commit d21b766 into master Mar 10, 2025
6 checks passed
@joyceqin-stripe joyceqin-stripe deleted the joyceqin/hide-default-checkbox-if-first branch March 10, 2025 21:02
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