Skip to content

Conversation

@david1alvarez
Copy link
Contributor

Because:

  • When the user had Link as their saved payment method, the Manage Payment Methods page would show the option to update/save their payment method even when no changes had been made

This commit:

  • Fixes the check to require a payment method ID. This results in the Payment Element correctly showing the "Set as default" button when a change is made, and not showing the button when no change is made.

Closes #PAY-3422

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

The PaymentMethod element no longer shows the button to set as default when Link is the default
Screenshot 2026-01-06 at 6 20 23 PM

Changing the payment method, and then changing back to Link still shows the button
Screenshot 2026-01-06 at 6 23 37 PM

Other information (Optional)

Any other information that is important to this pull request.

@david1alvarez david1alvarez requested a review from a team as a code owner January 7, 2026 02:30
Copy link
Contributor

@elizabeth-ilina elizabeth-ilina left a comment

Choose a reason for hiding this comment

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

I was able to reproduce the issue in this situation:

link-default-pm-bug.mov

What appears to be causing it is that in this situation, event.value.payment_method.id !== defaultPaymentMethodId (even though they should because the user only has 1 payment method saved). When a user clicks the button to save their current Link payment method as default, the event.value.payment_method.id and defaultPaymentMethodId switch values, and so they don’t match again. As the user clicks the button again, these values keep switching back and forth, and the "Set as default payment method" button is being displayed:

link-default-pm-switching-ids.mov

@david1alvarez david1alvarez force-pushed the PAY-3422 branch 2 times, most recently from 1b1622b to bb6c1d8 Compare January 10, 2026 00:58
@david1alvarez
Copy link
Contributor Author

The new behavior can be seen here. The non-optimal UX highlighted here is being tracked in PAY-3459, as this appears to be the component working as intended by Stripe.
https://github.com/user-attachments/assets/13e83e7b-e071-4b30-95a4-f2cff740ddee

Because:

* When the user had Link as their saved payment method, the Manage Payment Methods page would show the option to update/save their payment method even when no changes had been made

This commit:

* Fixes the logic that compares the selected vs default payment method states

Closes #PAY-3422
@david1alvarez david1alvarez merged commit 353600a into main Jan 12, 2026
20 checks passed
@david1alvarez david1alvarez deleted the PAY-3422 branch January 12, 2026 23:30
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