How to load MPGs 3dsecure authentication html response dynamically when user clicks on `place order` button in wordpress woocommerce

I am creating a custom plugin for a card payment gateway in woocommerce. by making API calls to MPGs API to achieve secure3dAuthentication. The response for secure3dauthentication returns a HTML response (as below).

How can I load the HTML content dynamically (either in a modal or redirect to a page dynamically with this HTML) once I receive the response when the user clicks the 'Placeorder' button on the process_payment function

I am using WordPress REST API for my API calls. It has not been possible to use jquery for the API calls due to CORS issues.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Process Secure Payment</title><meta http-equiv="content-type" content="text/html;charset=UTF-8"><meta name="description" content="Process Secure Payment"><meta name="robots" content="noindex">
<style type="text/css">body {font-family:"Trebuchet MS",sans-serif; background-color: #FFFFFF; }#msg {border:5px solid #666; background-color:#fff; margin:20px; padding:25px; max-width:40em; -webkit-border-radius: 10px; -khtml-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px;}#submitButton { text-align: center ; }#footnote {font-size:0.8em;}</style>
</head>
<body onload="return window.document.echoForm.submit()">
<form name="echoForm" method="POST" action="https://ap.gateway.mastercard.com/acs/VisaACS/ec6048ca-a987-4129-91a3-61843bbae2ee" accept-charset="UTF-8"><input type="hidden" name="PaReq" value="eAFVUctuwjAQvFfiH6LcG9vBIQEtRikkakpBlEer9pYGA6mIAYdX/75rHqW9eWa8s7uz0DoWS2svdZmvVNNmDrUtqbLVNFfzpj0Zx/eB3RKVOxgvtJSdkcx2WgroybJM59LKp03bpZRVa64X1P0qswUMwqHcCLh4CrR0XCBXiKU6W6RqKyDNNg9JX3Av8AMO5AKhkDrpiMClnDPqV7H2zIBKCynipD+Khq+RFcbDpB1az0kvGUcdICcVstVObfW34BQdrwB2eikOh4Mzy1Up9V466UznWQrECEBuIw12ZrgSNzzmUxHv209xR30NXkIvOhSftPc26b7XyIfuNYGYHzBNt1K41GW0xgKLsQbnDR4AOfGQFmYc0Y1GVne0sLjnUIqLnllYm2bhGXDPKH8ZwKQ1nuK6yxWBPK5XSqItJvP7BnIbvf1oss22mCLaBj5aM8/HMFndpHwSjEuOObmMYd8LAGJKyeWAGMvpyMj8O37l7gfXhLOp"><input type="hidden" name="TermUrl" value="http://localhost/market-place-101/?wc-api=WC_Gateway_JengaCardspay">
    <input type="hidden" name="MD" value="">
    <noscript>
        <div id="msg"><div id="submitButton">
        <input type="submit" value="Click here to continue" class="button">
        </div></div>
    </noscript>
</form>
</body>
</html>

class WC_Gateway_Cardspay extends WC_Payment_Gateway {  



    public function process_payment( $order_id ) {
        
        

        $order = wc_get_order( $order_id );

        if ( $order->get_total() > 0 ) {
        
        /*
    *load secure3dAuthenticate form         
    *expecting the page to redirect and load the html form
    */
        echo $this->processPayment($order);
    exit;

            
            
        } else {
            $order->payment_complete();
        }

        // Remove cart.
        WC()->cart->empty_cart();

        // Return thankyou redirect.
        return array(
            'result'   => 'success',
            'redirect' => $this->get_return_url( $order ),
        );
    }
  
    function processPayment($order){


        $authenticateCardPayment=new CardsAuthenticatePayment();            
        $authenticateCardPaymentResponse = $authenticateCardPayment->CardsAuthenticatePayment($order);


        if($authenticateCardPaymentResponse){   

            //html response
            return  $authenticateCardPaymentResponse['secureRes'];


        }
        return false;
    
    
}



}

?>