diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php index 50d607b..21d40f8 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php @@ -808,6 +808,9 @@ public function angelleye_get_multi_account_api_user_name($order_id) { public function angelleye_get_multi_account_by_order_total_latest($gateways, $gateway_setting, $order_id) { global $user_ID; $current_user_roles = array(); + if(!isset($gateways->testmode)) { + return; + } if (is_user_logged_in()) { $user = new WP_User($user_ID); if (!empty($user->roles) && is_array($user->roles)) { @@ -1182,7 +1185,9 @@ public function angelleye_paypal_for_woocommerce_multi_account_api_paypal_expres } else { $gateway_setting = $request; } - + if( !isset($gateways) || !isset($gateways->testmode)) { + return false; + } if ($order_id == null) { if (is_null(WC()->cart)) { return;