Open
Description
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
- 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 ) - Check if the client is in test or live mode. Make sure you have some transactions at least in test mode.
- Browse to
Payments > Overview
and take a look at the data within theYour payment activity
widget - Using the browser console, or WCPay Dev tools check the value of
wcpaySettings.liftetimeTPV
orlifetime_total_payment_volume
- Toggle the mode
- You will notice that the data in the widget does not change
- the lifetime TPV values also do not change as checked via steps in (4)
- Force update the cache using WCPay Dev Tools, or via
WooCommerce > Status > Tools > Clear WooPayments account cache
- 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.