Changes proposed in this Pull Request
This modifies the way that payment methods are displayed for a subscription when auto-renew is disabled.
Originally, if a subscription had auto-renew disabled (barring other factors like an expired card), the payment method was always displayed. This was changed in #46625 because some customers were confused that the payment method was displayed even when it would not be used. However, it turns out this also causes confusion because now the page is lying (there is actually a payment method assigned, even though it’s disabled); if auto-renew is turned back on, a payment method seems to appear out of nowhere. In addition, #46625 had the unintented side-effect of hiding the payment method if the card was expiring or had expired which also caused confusion.
In this PR we restore the original behavior of always displaying a payment method for a subscription with auto-renew disabled, but we grey-out the icon of that method to imply that the method will not be charged.
In addition, this adds unit tests to cover the various cases of how payment methods are displayed.
Fixes #48736
Before:
After:
Testing instructions
- Visit the subscription page for a plan.
- Turn off auto-renew for the subscription.
- Click to add a payment method to that subscription.
- Return to the subscription page.
- Verify that auto-renew is still disabled, but that the payment method does not display “None”.
- Verify that the payment method icon appears disabled.
Unfortunately, no screenshots were provided by the developer.