@@ -60,7 +60,10 @@ jQuery( function ( $ ) {
60
60
const disableManualRefunds = getConfig ( 'disableManualRefunds' ) ?? false ;
61
61
const manualRefundsTip = getConfig ( 'manualRefundsTip' ) ?? '' ;
62
62
const chargeId = getConfig ( 'chargeId' ) ;
63
- const orderTestMode = getConfig ( 'testMode' ) ;
63
+ const testMode = getConfig ( 'testMode' ) ;
64
+ // Order and site are both in test mode, or both in live mode.
65
+ // '1' = true, '' = false, null = the order was created before the test mode meta was added, so we assume it matches.
66
+ const orderTestModeMatch = getConfig ( 'orderTestModeMatch' ) !== '' ;
64
67
65
68
maybeShowOrderNotices ( ) ;
66
69
@@ -175,20 +178,16 @@ jQuery( function ( $ ) {
175
178
'#wcpay-order-payment-details-container'
176
179
) ;
177
180
178
- // Check if the order's test mode meta matches the site's current test mode setting.
179
- // E.g. order and site are both in test mode, or both in live mode.
180
- const isOrderTestModeMatch = orderTestMode === wcpaySettings . testMode ;
181
-
182
- // If the container doesn't exist (WC < 7.9) don't render the notice.
181
+ // If the container doesn't exist (WC < 7.9) don't render notices.
183
182
if ( ! container ) {
184
183
return ;
185
184
}
186
185
187
186
ReactDOM . render (
188
187
< >
189
- { orderTestMode && < TestModeNotice /> }
188
+ { testMode && < TestModeNotice /> }
190
189
191
- { isOrderTestModeMatch && chargeId && (
190
+ { chargeId && orderTestModeMatch && (
192
191
< DisputedOrderNoticeHandler
193
192
chargeId = { chargeId }
194
193
onDisableOrderRefund = { disableWooOrderRefundButton }
0 commit comments