add_action( 'woocommerce_before_pay_action', function( $order ){
  $user_id = get_post_meta( $order->get_id() , '_wpo_order_creator', true); // created using Phone Orders plugin?
  if($user_id AND $_POST['payment_method'] == "sagepaydirect" ){
  add_filter( 'http_request_args', function($data, $url ){
    parse_str($data["body"], $vars);
    $vars["Apply3DSecure"] = 2; // Do not perform 3D-Secure checks for this transaction and always authorise.
    $data["body"] = http_build_query( $vars );
    return $data;
  },10,2);
  }
});