Changes proposed in this Pull Request
When a purchase is currently being billed to an expired card or PayPal, that existing payment method is unavailable to select on the page for changing the purchase’s payment method. This pull request adds a message on the screen in each of those cases which should help make the user aware of their current payment method and the fact that if they make a selection on this page they’ll be switching to something else.
It also standardizes the behavior of pre-selecting the first payment method in the list when the current payment method is unavailable. That was already done for PayPal in #48466, but I’m extending it to expired cards here for consistency.
Before (expired card):
After (expired card):
Before (PayPal):
After (PayPal):
Testing instructions
Pay for a subscription with PayPal, visit it on the Manage Purchases page, and select the “Change Payment Method” option. Look for the new message on the resulting page.
You can do the same thing for a subscription paid for with an expired card, but that is harder to test (since you can’t add an already-expired card in the first place). The best way to test may be to edit the WordPress.com sandbox database on the server to force an existing card to have an expiration date in the past.
In any other scenario (subscription paid with a non-expired card, subscription with a deleted payment method, etc.) there should be no changes.
Fixes #48433
Unfortunately, no screenshots were provided by the developer.