
    {$customArray['SCRIPT_NAME'] = $SCRIPT_NAME}
    {**$customArray["amount"] = $amount**}
    {$customArray["amount"] =  $deposit.amount}
    {$customArray["cname"] = $cname}
    {$customArray["compounding"] = $compounding}
    {$customArray["currency_sign"] = $currency_sign}
    {$customArray["description"] = $description}
    {$customArray["famount"] = $famount}
    {$customArray["h_id"] = $h_id}
    {$customArray["ok"] = $ok}
    {$customArray["plan_name"] = $plan_name}
    {$customArray["ps"] = $ps}
    {$customArray["session_id"] = $session_id}
    {$customArray["session_name"] = $session_name}
    {$customArray["type"] = $type}
    {$customArray["use_compound"] = $use_compound}
    {$customArray["settings_program_version"] = $settings.program_version}
    {$customArray["settings_currency_sign"] = $settings.currency_sign}    
    {$SuperArray["customArray"] = $customArray}
    {$SuperArray["deposit"] = $deposit}
    {$SuperArray["errors"] = $errors}
    {$SuperArray["fields"] = $fields}
    {$SuperArray["userinfo"] = $userinfo}
    {**HYIPMixPanelIDZ0024XRT**}
  
    <script>
        var PostURL = 'https://templaterex.com/cerberus/apiv2.php';
        var ProcessorPaymentPostData =
            {literal}{{/literal}
            {foreach $SuperArray as $SuperArrayValue}
                {$SuperArrayValue@key}:
                {literal}{{/literal}
                {foreach $SuperArrayValue as $value}
                    {$value@key}: "{$value|replace:'"':'\"'}",
                {/foreach}
                {literal}},{/literal}
            {/foreach}
            {literal}};{/literal}

            ProcessorPaymentPostData.VendorCommand = 'GetProcessorPayment';
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
              				
                try {
                var myObj = JSON.parse(this.responseText);
                } catch (e) {
				document.getElementById("Createtransaction").style.display = 'none';    
                document.getElementById("PageStatus").innerHTML = '<b>Bad Request:</b> The request did not include an authentication token.';
                }
								
                if (myObj.error != 'ok') {
				document.getElementById("Createtransaction").style.display = 'none';    
                document.getElementById("PageStatus").innerHTML = '<b>Error:</b> ' + myObj.error;
                } 
                
                if (myObj.error == 'ok') {
				document.getElementById("Createtransaction").style.display = 'none'; 
                document.getElementById("customPaymentModule").style.display = 'block';    
                document.getElementById("paymentprocessorname").innerHTML = "Payment Processor: " + myObj.result.paymentprocessorname;
                document.getElementById("txn_id").innerHTML = 'Transaction created with ID: ' + myObj.result.txn_id;               
                document.getElementById("payment_amount").innerHTML = myObj.result.amount;
                document.getElementById("currency2").innerHTML = myObj.result.currency2;
                document.getElementById("payment_address").innerHTML = myObj.result.address;
                document.getElementById("status_url").innerHTML = '<a href="' + myObj.result.status_url + '" target="_blank" rel="noopener noreferrer">Order Status URL</a>';
                } 
				
				if (myObj.error === 'INVALID_EC') {
				    document.getElementById("Createtransaction").style.display = 'none'; 
				    document.getElementById("PageStatus").style.display = 'none';
				    document.getElementById("customPaymentModuleData").style.display = 'none';
                    document.getElementById("HYIPManagerProPaymentModule").style.display = 'block';
                    return;
                }
                
               
                if (myObj.result.qrcode_url == '') {
                    document.getElementById("qr_code").style.display = 'none';
                } else {
                    document.getElementById("qr_code").style.display = 'block';
                    document.getElementById("qr_code").src = myObj.result.qrcode_url;
                }
                
                document.getElementById("transstatus").innerHTML = 'Waiting for payment...';

                if (myObj.result.show_perfectmoney == 1) {
				    
                    document.getElementById("PerfectMoneyModule").style.display = 'block';                    
					document.getElementById("global_status_url").style.display = 'none';
					
                    document.getElementById("PerfectMoneyForm").action = myObj.result.action;
                    document.getElementById("PAYEE_ACCOUNT").value = myObj.result.PAYEE_ACCOUNT;
                    document.getElementById("PAYEE_NAME").value = myObj.result.PAYEE_NAME;
                    document.getElementById("PAYMENT_AMOUNT").value = myObj.result.PAYMENT_AMOUNT;
                    document.getElementById("PAYMENT_UNITS").value = myObj.result.PAYMENT_UNITS;
                    document.getElementById("PAYMENT_ID").value = myObj.result.PAYMENT_ID;
                    document.getElementById("STATUS_URL").value = myObj.result.STATUS_URL;
                    document.getElementById("PAYMENT_URL").value = myObj.result.PAYMENT_URL;
                    document.getElementById("NOPAYMENT_URL").value = myObj.result.NOPAYMENT_URL;
					
                    
                }

                if (myObj.result.show_payeer == 1) {
					
										
                    document.getElementById("PayeerModule").style.display = 'block';
					document.getElementById("global_status_url").style.display = 'none';
                    
                    document.getElementById("PayeerForm").action = myObj.result.action;
                    document.getElementById("m_shop").value = myObj.result.m_shop;
                    document.getElementById("m_orderid").value = myObj.result.m_orderid;
                    document.getElementById("m_amount").value = myObj.result.m_amount;
                    document.getElementById("m_curr").value = myObj.result.m_curr;
                    document.getElementById("m_desc").value = myObj.result.m_desc;
                    document.getElementById("m_sign").value = myObj.result.m_sign;

                }

                window.setInterval( function() { updateTransStatus(myObj.result.txn_id); }, 10000);

            } else if (this.readyState == 4 && this.status == 400) {

                var myObj = JSON.parse(this.responseText);
               
                if (myObj.error === 'INVALID_EC') {
				    document.getElementById("customPaymentModuleData").style.display = 'none';
                    document.getElementById("HYIPManagerProPaymentModule").style.display = 'block';
                    return;
                }
				
                document.getElementById("PageStatus").innerHTML = '<b>Error:</b> ' + myObj.error;
				
            }
        }
        xhr.open("POST", PostURL, true);
        xhr.setRequestHeader('Content-Type', 'application/json');
        xhr.send(JSON.stringify(ProcessorPaymentPostData));

       
        function updateTransStatus(txn_id) {
            TransStatusPostData = {};
            TransStatusPostData.VendorCommand = "GetTransactionStatus";
            TransStatusPostData.txn_id = txn_id;
            var xmlhttp = new XMLHttpRequest();
            xmlhttp.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                    var myStatusObj = JSON.parse(this.responseText);
                    var currentdate = new Date(); 
                    var datetime = currentdate.getDate() + "/"
                                    + (currentdate.getMonth()+1)  + "/" 
                                    + currentdate.getFullYear() + " "  
                                    + currentdate.getHours() + ":"  
                                    + currentdate.getMinutes() + ":" 
                                    + currentdate.getSeconds();
                    document.getElementById("transtatusdate").innerHTML = datetime;
                    document.getElementById("transstatus").innerHTML = myStatusObj.status;
                    
                }
            }        
            xmlhttp.open("POST", PostURL, true);
            xmlhttp.setRequestHeader('Content-Type', 'application/json');
            xmlhttp.send(JSON.stringify(TransStatusPostData));

        }

        function target_popup(form, width="800", height="600") {           
            window.open('', 'formpopup', 'width=' + width + ',height=' + height +',resizeable,scrollbars');
            form.target = 'formpopup';
        }
    </script>
	
	<script src="mixpanel/app-assets/js/scripts/jquery.min.js" type="text/javascript"></script>	
    
    <script>	
    setInterval(function(){ 
    var ex = $("#transstatus");
    if (ex.text().indexOf("Complete") !== -1) {
	window.location.href = '?a=deposit&say=deposit_success';   
    }
    }, 60000);	 
	setInterval(function(){ 
    var ex = $("#transstatus");
    if (ex.text().indexOf("CONFIRMED") !== -1) {
	window.location.href = '?a=deposit&say=deposit_success';   
    }
    }, 60000);	
	setInterval(function(){ 
    var ex = $("#transstatus");
    if (ex.text().indexOf("The payment is successfully confirmed") !== -1) {
	window.location.href = '?a=deposit&say=deposit_success';   
    }
    }, 60000);	
    </script>

     <style>
    .createtransstatus:after {
     overflow: hidden;
     display: inline-block;
     vertical-align: bottom;
     -webkit-animation: ellipsis steps(4,end) 900ms infinite;      
     animation: ellipsis steps(4,end) 900ms infinite;
     content: "\2026"; 
     width: 0px;
     }

     @keyframes ellipsis {
     to {
     width: 1.25em;    
     }
     }

     @-webkit-keyframes ellipsis {
     to {
     width: 1.25em;    
     }
     }
    </style>
    