Skip to content

Reporting: Payment activity widget not refreshed automatically when toggling test mode #9027

Open
@nagpai

Description

@nagpai

Describe the bug

When we toggle test/live mode on the client/plugin, the payment activity widget within Payments > Overview continues to show the summary data of the previous mode. This is refreshed after the WooPayments Account cache is refreshed manually.

Expected behavior

The payment widget should update automatically to the test mode / live mode data, whenever it is changed, without needing a manual cache refresh.

To Reproduce

Use a test website connected to a live account

  1. On the client, enable the _wcpay_feature_payment_overview_widget feature flag ( if you are testing this before Enable the Payment Activity Card for all merchants (remove feature flag _wcpay_feature_payment_overview_widget) #9012 is merged )
  2. Check if the client is in test or live mode. Make sure you have some transactions at least in test mode.
  3. Browse to Payments > Overview and take a look at the data within the Your payment activity widget
  4. Using the browser console, or WCPay Dev tools check the value of wcpaySettings.liftetimeTPV or lifetime_total_payment_volume
  5. Toggle the mode
  6. You will notice that the data in the widget does not change
  7. the lifetime TPV values also do not change as checked via steps in (4)
  8. Force update the cache using WCPay Dev Tools, or via WooCommerce > Status > Tools > Clear WooPayments account cache
  9. The widget now shows the correct information. The lifetime TPV updates to the correct value too.

Additional context

The issue was observed while resolving #8958 . I created a separate issue, since I also wanted to context switch to Multiprocessor project, while making sure this is not missed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugcategory: projectsFor any issues which are part of any project, including bugs, enhancements, etc.focus: reporting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions