Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
85 stars 31 forks source link

Highlight overdue/late payments in admin subscriptions list #354

Closed haszari closed 1 year ago

haszari commented 1 year ago

Fixes #260

Description

Occasionally subscriptions can show as Active status when payment is overdue, in particular with offsite billing (e.g. WCPay Subscriptions using Stripe Billing).

The goal of this PR is to highlight active subscriptions that may have overdue or missed payment issues.

The existing i info button / tooltip component now shows red if payment is overdue. The tooltip message reads: Subscription payment overdue.

This could help merchants take action, e.g. recover payment or suspend.

Note this is a low-risk tweak to help mitigate this situation with minimal change to the existing UI. This issue is relatively rare in WCPay Subscriptions (estimated affecting 1-5% of merchants), so it's not worth making any more extensive changes right now.

Other options were considered, and could be improvements in future:

Above screenshot shows both info (1 offsite renewal) and (2 overdue payment). Red icon is only used for overdue, and overdue payment message is displayed first and in bold, to disambiguate & highlight most important issue. When payment is overdue, the renewal mechanism (offsite vs tokenised onsite) is important info, so deliberately including that in tooltip when applicable.

How to test this PR

  1. Ensure you have some subscription products. Can use WC Subscriptions or WCPay Subscriptions. Tip: use daily subscription term so you have more renewal events to test with over time :)
  2. Purchase a subscription or set up a subscription.
  3. Prevent payment on renewal, or simulate this, for example:
    • Manual subscription - no auto renewal, will go overdue on renewal date.
    • Hack subscription next payment date in the past - set _schedule_next_payment post meta (aka subscription meta).
  4. Go to wp-admin > Dashboard > Subscriptions. Any overdue subscriptions should show red icon.

Product impact

haszari commented 1 year ago

Hitting pause on this PR. I'm switching approach, focus on adding logging and/or order notes for suspend / pause collection requests in WCPay client, to help diagnose the root cause affecting these stores.

haszari commented 1 year ago

Hitting pause on this PR. I'm switching approach, focus on adding logging and/or order notes for suspend / pause collection requests in WCPay client, to help diagnose the root cause affecting these stores.

Unblocked, will implement subtle red icon design: https://github.com/Automattic/woocommerce-subscriptions-core/issues/260#issuecomment-1387697410

haszari commented 1 year ago

Currently looks like this, using existing icon:

Screenshot 2023-01-19 at 11 27 18 AM

At a minimum I'm thinking we need to only show a single combined icon + tooltip in each row - tbc. Updated

Would be good to use a modern icon from wp components / gutenberg, will investigate options. However the existing icon + tooltip UX is most consistent so may move forward with that.

haszari commented 1 year ago

Requesting review from Helix and also @james-allan second opinion since he's up to speed on the wider context here.

haszari commented 1 year ago

Thanks for the instructive feedback @james-allan - ready for another review/test, if all good feel free to merge if I'm not around.

james-allan commented 1 year ago

Changes look good to me and test well. In line with your comment above, I'll go ahead and merge this. πŸ˜„