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 b518a31..a44a928 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin.php @@ -799,6 +799,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)) { @@ -1173,7 +1176,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;