Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php goto MMTi2; MMTi2: defined("\101\102\123\x50\x41\x54\110") or die; goto ug0CY; ..

Decoded Output download

<?php 
goto MMTi2; 
MMTi2: 
defined("ABSPATH") or die; 
goto ug0CY; 
WI8d2: 
add_filter("plugin_action_links_" . plugin_basename(__FILE__), "wc_qpay_gateway_plugin_links"); 
goto jKFf1; 
l0vhj: 
function wc_qpay_gateway_plugin_links($links) 
{ 
    $plugin_links = array("<a href="" . admin_url("admin.php?page=wc-settings&tab=checkout&section=qpay_gateway") . "">" . __("Configure", "wc-gateway-qpay") . "</a>"); 
    return array_merge($plugin_links, $links); 
} 
goto WI8d2; 
ug0CY: 
if (!in_array("woocommerce/woocommerce.php", apply_filters("active_plugins", get_option("active_plugins")))) { 
    return; 
} 
goto Dirkf; 
jKFf1: 
add_action("plugins_loaded", "wc_qpay_qpay_gateway_init", 11); 
goto fTg_r; 
e6m78: 
add_filter("woocommerce_payment_gateways", "wc_qpay_add_to_gateways"); 
goto l0vhj; 
Dirkf: 
function wc_qpay_add_to_gateways($gateways) 
{ 
    $gateways[] = "WC_Gateway_Qpay"; 
    return $gateways; 
} 
goto e6m78; 
fTg_r: 
function wc_qpay_qpay_gateway_init() 
{ 
    class WC_Gateway_Qpay extends WC_Payment_Gateway 
    { 
        public function __construct() 
        { 
            $this->qimage = ''; 
            $this->id = "qpay_gateway"; 
            $this->icon = apply_filters("woocommerce_qpay_icon", plugin_dir_url(__FILE__) . "/images/icon.png"); 
            $this->has_fields = false; 
            $this->method_title = __("Qpay Payment Gateway Configure V2", "wc-gateway-qpay"); 
            $this->method_description = __("Qpay Allowed bank apps are accessable included qpay", "wc-gateway-qpay"); 
            $this->notify_url = WC()->api_request_url("WC_Gateway_Qpay"); 
            $this->init_form_fields(); 
            $this->init_settings(); 
            $this->title = $this->get_option("title"); 
            $this->description = $this->get_option("description"); 
            $this->merchant_url = $this->get_option("merchant_url"); 
            $this->merchant_username = $this->get_option("merchant_username"); 
            $this->merchant_password = $this->get_option("merchant_password"); 
            $this->merchant_invoice_code = $this->get_option("merchant_invoice_code"); 
            add_action("woocommerce_update_options_payment_gateways_" . $this->id, array($this, "process_admin_options")); 
            add_action("woocommerce_api_wc_gateway_qpay_webhook", array($this, "qpay_response_webhook")); 
            add_action("woocommerce_api_wc_gateway_qpay", array($this, "qpay_response")); 
            add_action("wp_enqueue_scripts", array($this, "qpay_scripts")); 
        } 
        public function init_form_fields() 
        { 
            $this->form_fields = apply_filters("wc_qpay_form_fields", array("enabled" => array("title" => __("Enable/Disable", "wc-gateway-qpay"), "type" => "checkbox", "label" => __("Enable Qpay Payment", "wc-gateway-qpay"), "default" => "yes"), "title" => array("title" => __("Title", "wc-gateway-qpay"), "type" => "text", "description" => __("This controls the title for the payment method the customer sees during checkout.", "wc-gateway-qpay"), "default" => __("Qpay", "wc-gateway-qpay"), "desc_tip" => true), "description" => array("title" => __("Description", "wc-gateway-qpay"), "type" => "textarea", "description" => __("Payment method description that the customer will see on your checkout.", "wc-gateway-qpay"), "default" => __("QPay     QR     .", "wc-gateway-qpay"), "desc_tip" => true), "merchant_url" => array("title" => __("URL", "wc-gateway-qpay"), "type" => "text", "description" => __("Put your URL here.", "wc-gateway-qpay"), "default" => __('', "wc-gateway-qpay"), "desc_tip" => true), "merchant_username" => array("title" => __("Username", "wc-gateway-qpay"), "type" => "text", "description" => __("Put your username here.", "wc-gateway-qpay"), "default" => __('', "wc-gateway-qpay"), "desc_tip" => true), "merchant_password" => array("title" => __("Password", "wc-gateway-qpay"), "type" => "text", "description" => __("Put your password here.", "wc-gateway-qpay"), "default" => __('', "wc-gateway-qpay"), "desc_tip" => true), "merchant_invoice_code" => array("title" => __("Invoice Code", "wc-gateway-qpay"), "type" => "text", "description" => __("Put your invoice code here.", "wc-gateway-qpay"), "default" => __('', "wc-gateway-qpay"), "desc_tip" => true))); 
        } 
        public function process_payment($order_id) 
        { 
            $order = wc_get_order($order_id); 
            $amount = $order->get_total(); 
            $token = $this->get_qpay_token(); 
            $resCreate = array(); 
            if ($token) { 
                $responseCreate = wp_remote_post($this->merchant_url . "invoice", array("headers" => array("Authorization" => "Bearer " . $token), "body" => array("invoice_code" => $this->merchant_invoice_code, "sender_invoice_no" => $order_id, "invoice_receiver_code" => "terminal", "invoice_description" => $order_id, "amount" => $amount, "callback_url" => get_site_url(null, "wc-api/wc_gateway_qpay_webhook?order_id=" . $order_id)))); 
                if (is_wp_error($responseCreate)) { 
                    $error_message = $responseCreate->get_error_message(); 
                    echo "Something went wrong: {$error_message}"; 
                } else { 
                    $resCreate = json_decode($responseCreate["body"], true); 
                    add_post_meta($order_id, "qpay_qrcode", $resCreate["qr_image"], true); 
                    add_post_meta($order_id, "qpay_invoice_id", $resCreate["invoice_id"], true); 
                    add_post_meta($order_id, "qpay_callback_url", get_site_url(null, "wc-api/wc_gateway_qpay_webhook?order_id=" . $order_id), true); 
                } 
            } 
            $body = "<html><body><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script><script>"; 
            $body .= "var div = document.getElementsByClassName("payment_method_qpay_gateway")[1];"; 
            $body .= "var childs = div.children;"; 
            $body .= "var holder = document.createElement("div");"; 
            $body .= "var img = document.createElement("img");"; 
            $body .= "var p = document.createElement("p");"; 
            $body .= "var warn = document.createElement("p");"; 
            $body .= "var a = document.createElement("a");"; 
            $body .= "img.setAttribute("src", "data:image/png;base64," . $resCreate["qr_image"] . "");"; 
            $body .= "holder.classList.add("qpay_holder");"; 
            $body .= "img.classList.add("qpay-qr");"; 
            $body .= "warn.classList.add("qpay-warning");"; 
            $body .= "div.innerHTML = "";"; 
            $body .= "a.innerText = "           !";"; 
            $body .= "a.setAttribute("href", "" . $resCreate["qPay_shortUrl"] . "");"; 
            $body .= "a.classList.add("qpay-mobile-app-links");"; 
            $body .= "p.innerHTML = "" . $this->description . "";"; 
            $body .= "warn.innerHTML = "      !";"; 
            $body .= "holder.appendChild(p);"; 
            $body .= "holder.appendChild(img);"; 
            if (wp_is_mobile()) { 
                $body .= "let qpay_mobile_div = document.createElement("div");"; 
                $body .= "qpay_mobile_div.classList.add("qpay-mobile-link-container");"; 
                foreach ($resCreate["urls"] as $k => $u) { 
                    $body .= "let m_img_" . $k . " = document.createElement("img");"; 
                    $body .= "m_img_" . $k . ".setAttribute("src", "" . $u["logo"] . "");"; 
                    $body .= "m_img_" . $k . ".setAttribute("alt", "" . $u["description"] . "");"; 
                    $body .= "let m_a_" . $k . " = document.createElement("a");"; 
                    $body .= "m_a_" . $k . ".setAttribute("title", "" . $u["description"] . "");"; 
                    $body .= "m_a_" . $k . ".setAttribute("href", "" . $u["link"] . "");"; 
                    $body .= "m_a_" . $k . ".appendChild(m_img_" . $k . ");"; 
                    $body .= "qpay_mobile_div.appendChild(m_a_" . $k . ");"; 
                } 
                $body .= "holder.appendChild(qpay_mobile_div);"; 
            } 
            $body .= "holder.appendChild(warn);"; 
            $body .= "div.appendChild(holder);"; 
            $body .= "var timer = setInterval(()=>{jQuery.ajax({url: 'wc-api/WC_Gateway_Qpay',type: "GET",data: {invoiceId: "" . $resCreate["invoice_id"] . "", orderId: " . $order_id . ", token: "" . $token . "" },dataType: "html",success: function(data){var dta = JSON.parse(data);if(dta && dta.redirect){window.location.href = dta.redirect; clearInterval(timer);};},error: function(jqXHR, exception){}});},10000);"; 
            $body .= "</script></body></html>"; 
            $fr = array("result" => "success", "qPay_QRimage" => $resCreate["qr_image"], "qPay_QRcode" => $resCreate["qr_text"], "qPay_url" => $resCreate["qPay_shortUrl"], "invoice_id" => $resCreate["invoice_id"], "order_id" => $order_id, "messages" => $body, "response" => $responseCreate); 
            if (!wp_doing_ajax()) { 
                $fr["redirect"] = wc_get_checkout_url(); 
            } 
            return $fr; 
        } 
        public function qpay_response() 
        { 
            $responseCheck = wp_remote_post($this->merchant_url . "payment/check", array("headers" => array("Authorization" => "Bearer " . $_GET["token"]), "body" => array("object_type" => "INVOICE", "object_id" => $_GET["invoiceId"], "offset" => array("page_number" => 1, "page_limit" => 100)))); 
            $order = wc_get_order($_GET["orderId"]); 
            if (is_wp_error($responseCheck)) { 
                $error_message = $responseCheck->get_error_message(); 
                echo "Something went wrong: {$error_message}"; 
            } else { 
                $resCheck = json_decode($responseCheck["body"], true); 
                if (isset($resCheck["paid_amount"]) && intval($resCheck["paid_amount"]) >= intval($order->get_total()) && intval($resCheck["count"]) > 0 && count($resCheck["rows"]) > 0) { 
                    add_post_meta($_GET["orderId"], "qpay_response", json_encode($responseCheck["body"])); 
                    $order->payment_complete(); 
                    return wp_send_json(array("redirect" => get_home_url() . "/checkout/order-received/" . $_GET["orderId"] . "?key=" . $order->get_order_key() . '')); 
                } else { 
                    if (isset($resCheck["error"]) && $resCheck["error"] == "NO_CREDENDIALS") { 
                        $token = $this->get_qpay_token(); 
                        if ($token) { 
                            $responseCheck = wp_remote_post($this->merchant_url . "payment/check", array("headers" => array("Authorization" => "Bearer " . $token), "body" => array("object_type" => "INVOICE", "object_id" => $_GET["invoiceId"], "offset" => array("page_number" => 1, "page_limit" => 100)))); 
                            if (is_wp_error($responseCheck)) { 
                                $error_message = $responseCheck->get_error_message(); 
                                echo "Something went wrong: {$error_message}"; 
                            } else { 
                                $resCheck = json_decode($responseCheck["body"], true); 
                                if (isset($resCheck["paid_amount"]) && intval($resCheck["paid_amount"]) >= intval($order->get_total()) && intval($resCheck["count"]) > 0 && count($resCheck["rows"]) > 0) { 
                                    add_post_meta($_GET["orderId"], "qpay_response", json_encode($responseCheck["body"])); 
                                    $order->payment_complete(); 
                                    return wp_send_json(array("redirect" => get_home_url() . "/checkout/order-received/" . $_GET["orderId"] . "?key=" . $order->get_order_key() . '')); 
                                } 
                            } 
                        } 
                    } 
                } 
            } 
            return wp_send_json_error(array()); 
        } 
        private function get_qpay_token() 
        { 
            $response = wp_remote_post($this->merchant_url . "auth/token", array("headers" => array("Authorization" => "Basic " . base64_encode($this->merchant_username . ":" . $this->merchant_password)))); 
            if (is_wp_error($response)) { 
                $error_message = $response->get_error_message(); 
                wp_die("Something went wrong: " . $error_message); 
            } else { 
                $res_arr = json_decode($response["body"], true); 
                return $res_arr["access_token"]; 
            } 
            return false; 
        } 
        public function qpay_response_webhook() 
        { 
            if (empty($_GET["order_id"])) { 
                die("{"success":"empty"}"); 
            } 
            $invoice_id = get_post_meta($_GET["order_id"], "qpay_invoice_id", true); 
            $token = $this->get_qpay_token(); 
            if ($token) { 
                $responseCheck = wp_remote_post($this->merchant_url . "payment/check", array("headers" => array("Authorization" => "Bearer " . $token), "body" => array("object_type" => "INVOICE", "object_id" => $invoice_id, "offset" => array("page_number" => 1, "page_limit" => 100)))); 
                if (is_wp_error($responseCheck)) { 
                    $error_message = $responseCheck->get_error_message(); 
                    wp_die("Something went wrong: " . $error_message); 
                } else { 
                    $resCheck = json_decode($responseCheck["body"], true); 
                    $order = wc_get_order($_GET["order_id"]); 
                    if (intval($resCheck["paid_amount"]) >= intval($order->get_total()) && intval($resCheck["count"]) > 0 && count($resCheck["rows"]) > 0) { 
                        $order->payment_complete(); 
                        die("{"success":true}"); 
                    } 
                } 
            } 
            die("{"success":false}"); 
        } 
        public function qpay_scripts() 
        { 
            wp_enqueue_style("qpay-css", plugin_dir_url(__FILE__) . "style.css", '', '', "screen"); 
        } 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php
goto MMTi2;
MMTi2:
defined("\101\102\123\x50\x41\x54\110") or die;
goto ug0CY;
WI8d2:
add_filter("\x70\x6c\165\x67\x69\156\137\141\x63\164\151\x6f\x6e\x5f\x6c\151\156\153\x73\137" . plugin_basename(__FILE__), "\167\x63\137\x71\x70\x61\x79\x5f\x67\141\x74\x65\167\x61\x79\137\x70\154\165\147\x69\156\137\154\151\156\x6b\163");
goto jKFf1;
l0vhj:
function wc_qpay_gateway_plugin_links($links)
{
    $plugin_links = array("\x3c\141\x20\150\162\145\x66\x3d\42" . admin_url("\141\x64\155\151\x6e\x2e\160\150\160\77\160\x61\147\x65\x3d\x77\x63\x2d\x73\145\x74\164\x69\156\147\x73\x26\164\141\142\x3d\143\x68\x65\x63\153\x6f\x75\x74\x26\163\145\143\164\151\x6f\x6e\x3d\x71\x70\x61\x79\137\147\x61\164\145\x77\x61\x79") . "\x22\76" . __("\103\157\156\146\151\147\x75\162\x65", "\167\143\55\x67\x61\x74\145\x77\141\x79\55\x71\160\141\x79") . "\x3c\57\141\x3e");
    return array_merge($plugin_links, $links);
}
goto WI8d2;
ug0CY:
if (!in_array("\x77\157\157\143\x6f\x6d\x6d\x65\162\143\145\57\167\157\157\x63\x6f\155\155\145\x72\x63\x65\56\x70\x68\160", apply_filters("\141\143\x74\151\x76\x65\x5f\160\154\x75\147\151\x6e\163", get_option("\x61\143\x74\151\x76\145\x5f\160\154\165\147\151\x6e\x73")))) {
    return;
}
goto Dirkf;
jKFf1:
add_action("\x70\154\165\x67\x69\x6e\x73\x5f\x6c\x6f\141\x64\145\x64", "\167\143\137\161\x70\x61\171\137\161\160\x61\171\137\x67\x61\x74\145\167\x61\x79\137\x69\x6e\x69\x74", 11);
goto fTg_r;
e6m78:
add_filter("\x77\157\157\143\157\x6d\155\x65\162\x63\145\x5f\160\141\171\x6d\x65\x6e\164\x5f\x67\x61\x74\145\x77\141\x79\x73", "\167\143\137\161\x70\x61\171\x5f\141\144\x64\x5f\164\157\137\147\x61\x74\145\x77\x61\x79\163");
goto l0vhj;
Dirkf:
function wc_qpay_add_to_gateways($gateways)
{
    $gateways[] = "\127\x43\137\x47\x61\x74\x65\167\141\171\137\x51\160\141\171";
    return $gateways;
}
goto e6m78;
fTg_r:
function wc_qpay_qpay_gateway_init()
{
    class WC_Gateway_Qpay extends WC_Payment_Gateway
    {
        public function __construct()
        {
            $this->qimage = '';
            $this->id = "\x71\160\141\x79\137\147\141\164\145\x77\141\x79";
            $this->icon = apply_filters("\167\x6f\157\143\157\155\x6d\x65\x72\x63\145\x5f\x71\160\141\171\137\x69\x63\157\x6e", plugin_dir_url(__FILE__) . "\57\x69\x6d\141\147\x65\163\x2f\x69\x63\157\156\56\x70\156\x67");
            $this->has_fields = false;
            $this->method_title = __("\121\x70\141\x79\x20\120\x61\171\155\145\156\x74\40\x47\x61\164\x65\167\141\x79\x20\103\x6f\x6e\x66\151\x67\x75\162\x65\40\126\62", "\x77\x63\x2d\147\x61\x74\x65\x77\x61\171\x2d\161\x70\x61\171");
            $this->method_description = __("\121\160\x61\171\x20\101\154\x6c\157\x77\145\144\x20\142\141\x6e\x6b\40\x61\x70\x70\163\40\x61\x72\145\40\141\143\x63\145\163\x73\x61\x62\154\x65\x20\x69\x6e\143\154\x75\144\x65\x64\40\161\x70\x61\x79", "\x77\x63\x2d\x67\x61\164\x65\x77\141\x79\x2d\161\160\141\x79");
            $this->notify_url = WC()->api_request_url("\127\103\x5f\107\x61\164\x65\x77\x61\171\x5f\121\160\141\171");
            $this->init_form_fields();
            $this->init_settings();
            $this->title = $this->get_option("\164\151\164\x6c\x65");
            $this->description = $this->get_option("\x64\145\163\x63\162\x69\160\x74\x69\157\156");
            $this->merchant_url = $this->get_option("\155\x65\x72\x63\x68\x61\156\x74\137\165\162\x6c");
            $this->merchant_username = $this->get_option("\x6d\x65\x72\143\x68\x61\156\x74\137\x75\x73\145\162\156\x61\155\x65");
            $this->merchant_password = $this->get_option("\155\x65\x72\x63\150\141\x6e\x74\137\x70\x61\x73\x73\167\157\162\144");
            $this->merchant_invoice_code = $this->get_option("\155\145\x72\143\x68\141\x6e\164\x5f\151\156\166\x6f\x69\143\x65\137\x63\x6f\144\145");
            add_action("\x77\x6f\157\x63\157\155\x6d\x65\162\x63\x65\x5f\165\x70\x64\x61\164\x65\137\x6f\160\x74\151\x6f\x6e\x73\x5f\160\x61\x79\155\145\x6e\x74\x5f\147\141\164\x65\x77\x61\171\x73\137" . $this->id, array($this, "\160\x72\157\x63\145\x73\x73\x5f\x61\x64\x6d\151\156\137\x6f\160\164\x69\x6f\x6e\163"));
            add_action("\167\157\x6f\x63\x6f\155\155\x65\x72\143\145\137\x61\x70\x69\x5f\x77\143\137\147\x61\x74\x65\167\x61\171\x5f\161\x70\141\x79\137\167\145\142\x68\x6f\x6f\x6b", array($this, "\161\160\141\x79\x5f\162\x65\x73\160\157\x6e\x73\x65\x5f\x77\145\x62\150\x6f\157\x6b"));
            add_action("\x77\157\x6f\143\x6f\155\x6d\145\162\x63\145\137\x61\x70\x69\137\x77\143\x5f\147\141\164\x65\167\x61\171\x5f\x71\x70\x61\x79", array($this, "\161\160\x61\x79\137\162\x65\163\x70\x6f\156\163\x65"));
            add_action("\167\160\137\x65\x6e\161\165\145\x75\x65\x5f\163\x63\162\x69\160\x74\163", array($this, "\161\x70\141\171\137\163\x63\162\x69\160\164\163"));
        }
        public function init_form_fields()
        {
            $this->form_fields = apply_filters("\167\x63\137\x71\x70\x61\171\137\x66\x6f\x72\x6d\137\x66\x69\145\x6c\144\163", array("\145\x6e\141\142\154\x65\144" => array("\164\151\x74\154\x65" => __("\105\156\141\x62\x6c\145\57\x44\x69\163\x61\142\x6c\x65", "\167\143\x2d\147\x61\x74\x65\x77\x61\171\x2d\x71\x70\141\x79"), "\164\x79\160\145" => "\143\150\x65\x63\x6b\142\x6f\x78", "\154\141\x62\x65\154" => __("\x45\x6e\141\x62\x6c\x65\40\121\x70\x61\171\x20\x50\141\x79\x6d\x65\x6e\164", "\167\x63\x2d\147\141\x74\145\x77\x61\x79\55\161\160\141\x79"), "\x64\145\x66\x61\165\x6c\x74" => "\x79\x65\x73"), "\164\151\164\x6c\145" => array("\164\151\x74\154\x65" => __("\124\151\164\154\145", "\x77\x63\55\x67\141\x74\x65\x77\x61\x79\x2d\x71\x70\x61\171"), "\x74\171\x70\x65" => "\164\145\x78\164", "\x64\x65\x73\x63\162\x69\x70\x74\x69\x6f\156" => __("\124\150\151\163\40\x63\x6f\156\164\162\157\x6c\163\40\164\x68\x65\40\x74\x69\164\154\145\x20\x66\x6f\162\x20\164\x68\145\x20\x70\x61\171\x6d\145\156\x74\40\155\145\164\x68\157\144\40\x74\x68\x65\x20\143\x75\x73\x74\157\155\x65\162\40\163\145\x65\x73\x20\144\165\x72\x69\156\147\40\143\150\145\143\153\157\x75\164\56", "\x77\143\55\x67\x61\164\145\x77\x61\x79\55\x71\160\141\171"), "\144\145\x66\141\x75\x6c\164" => __("\x51\160\x61\x79", "\x77\x63\55\147\141\x74\145\x77\141\x79\x2d\x71\x70\141\171"), "\144\145\x73\x63\x5f\x74\151\x70" => true), "\x64\145\x73\143\162\151\160\x74\151\157\156" => array("\x74\x69\164\154\x65" => __("\104\x65\x73\143\x72\151\160\164\x69\157\156", "\x77\x63\55\147\141\x74\145\x77\x61\x79\x2d\161\160\141\171"), "\164\x79\160\145" => "\x74\x65\170\x74\141\162\x65\x61", "\144\145\163\143\162\151\x70\164\x69\x6f\x6e" => __("\x50\x61\171\155\145\x6e\164\x20\x6d\145\164\x68\157\144\x20\x64\x65\x73\x63\162\151\160\x74\x69\x6f\x6e\x20\x74\150\141\164\x20\x74\x68\x65\x20\143\165\x73\164\x6f\x6d\145\162\x20\167\151\x6c\154\x20\x73\145\145\40\x6f\156\40\171\157\x75\x72\40\x63\150\x65\x63\x6b\x6f\x75\x74\x2e", "\x77\143\55\x67\141\x74\145\167\x61\x79\55\x71\160\x61\171"), "\x64\x65\x66\x61\x75\x6c\x74" => __("\x51\x50\x61\x79\40\xd2\257\xd0\271\320\273\xd1\207\320\xb8\xd0\273\320\xb3\321\215\321\x8d\320\263\40\xd0\xb0\321\x88\320\270\xd0\xb3\320\xbb\xd0\xb0\xd0\xbd\40\320\xb3\xd0\xb0\321\200\40\xd1\x83\xd1\202\321\201\320\260\320\260\xd1\200\xd0\260\xd0\xb0\40\121\122\40\xd0\272\320\276\xd0\264\x20\xd1\x83\320\xbd\xd1\x88\xd1\203\xd1\203\320\273\320\260\320\275\x20\321\202\323\xa9\xd0\xbb\xd0\261\xd3\xa9\xd1\x80\x20\xd1\x82\xd3\xa9\320\xbb\323\251\321\205\x20\320\261\320\xbe\xd0\273\320\xbe\320\274\320\xb6\321\x82\xd0\xbe\xd0\xb9\x2e", "\x77\x63\x2d\x67\141\x74\x65\x77\x61\x79\x2d\161\160\x61\171"), "\x64\x65\x73\143\137\x74\151\x70" => true), "\155\145\162\143\150\x61\x6e\164\137\165\162\x6c" => array("\x74\x69\x74\x6c\x65" => __("\x55\x52\x4c", "\x77\143\x2d\147\x61\164\145\x77\141\171\x2d\x71\x70\141\x79"), "\x74\171\160\x65" => "\164\145\x78\x74", "\x64\145\x73\143\162\151\160\164\x69\x6f\156" => __("\x50\x75\164\x20\171\x6f\165\x72\x20\125\122\114\x20\x68\145\162\145\56", "\x77\x63\55\x67\141\164\x65\x77\141\x79\55\161\160\x61\171"), "\x64\145\146\x61\165\154\164" => __('', "\x77\143\x2d\x67\x61\x74\145\167\x61\171\55\x71\160\x61\171"), "\144\x65\163\x63\137\164\151\160" => true), "\x6d\x65\x72\x63\x68\x61\156\x74\x5f\x75\163\145\162\156\x61\x6d\x65" => array("\164\151\x74\x6c\x65" => __("\125\163\x65\162\156\141\155\x65", "\x77\x63\x2d\147\x61\x74\145\167\x61\171\x2d\161\160\x61\171"), "\164\171\160\x65" => "\164\x65\x78\164", "\x64\x65\163\143\162\x69\160\x74\151\157\x6e" => __("\x50\165\164\40\x79\x6f\x75\x72\x20\165\x73\145\162\x6e\141\155\x65\40\x68\145\x72\145\56", "\x77\x63\55\x67\x61\x74\145\x77\141\171\x2d\161\160\x61\x79"), "\x64\x65\x66\x61\165\x6c\164" => __('', "\x77\143\55\x67\x61\x74\145\167\x61\171\55\161\x70\141\x79"), "\144\145\x73\x63\x5f\164\x69\x70" => true), "\155\x65\162\x63\150\x61\156\x74\137\x70\x61\x73\x73\167\157\162\144" => array("\164\151\164\x6c\x65" => __("\x50\141\x73\x73\x77\x6f\162\144", "\167\143\x2d\147\141\164\145\167\x61\x79\x2d\x71\160\x61\x79"), "\164\171\160\145" => "\x74\x65\x78\164", "\x64\145\163\x63\162\x69\x70\164\x69\x6f\x6e" => __("\x50\x75\x74\40\171\x6f\x75\162\40\x70\141\x73\163\167\x6f\162\x64\40\150\145\x72\145\x2e", "\167\x63\x2d\147\141\164\x65\167\x61\x79\55\x71\160\141\171"), "\144\x65\146\x61\x75\154\x74" => __('', "\167\143\55\147\141\x74\x65\167\x61\171\55\161\x70\x61\x79"), "\144\145\x73\143\137\x74\x69\160" => true), "\155\x65\x72\x63\150\x61\156\x74\x5f\151\156\x76\157\151\x63\x65\137\143\x6f\x64\x65" => array("\x74\151\164\x6c\x65" => __("\x49\x6e\x76\x6f\x69\143\x65\40\x43\157\x64\x65", "\x77\143\55\x67\x61\x74\x65\167\141\171\x2d\x71\x70\x61\171"), "\164\x79\x70\x65" => "\164\145\170\x74", "\144\x65\163\143\x72\151\160\x74\151\x6f\156" => __("\120\165\164\40\x79\157\165\x72\x20\x69\156\166\157\151\143\145\40\x63\x6f\x64\x65\x20\150\145\162\145\x2e", "\x77\143\55\x67\x61\x74\145\x77\x61\171\x2d\x71\x70\x61\171"), "\144\x65\146\x61\165\154\x74" => __('', "\167\143\55\147\141\164\x65\167\x61\x79\55\x71\x70\141\x79"), "\144\145\x73\x63\x5f\164\x69\x70" => true)));
        }
        public function process_payment($order_id)
        {
            $order = wc_get_order($order_id);
            $amount = $order->get_total();
            $token = $this->get_qpay_token();
            $resCreate = array();
            if ($token) {
                $responseCreate = wp_remote_post($this->merchant_url . "\x69\156\166\x6f\x69\143\145", array("\x68\145\x61\x64\145\x72\x73" => array("\x41\165\164\150\x6f\x72\151\x7a\x61\164\151\x6f\156" => "\102\145\x61\162\145\x72\x20" . $token), "\142\x6f\144\171" => array("\x69\156\166\157\151\143\145\137\143\157\x64\145" => $this->merchant_invoice_code, "\163\x65\x6e\144\x65\162\137\x69\156\166\157\x69\143\x65\x5f\x6e\157" => $order_id, "\x69\156\166\157\151\x63\145\x5f\162\145\143\x65\x69\166\x65\162\x5f\143\157\x64\145" => "\x74\x65\162\x6d\x69\x6e\x61\x6c", "\151\x6e\166\x6f\x69\x63\145\x5f\144\145\163\x63\162\x69\x70\x74\151\157\x6e" => $order_id, "\x61\155\157\x75\156\x74" => $amount, "\x63\141\x6c\154\142\x61\x63\x6b\x5f\x75\162\x6c" => get_site_url(null, "\167\143\x2d\x61\160\151\57\x77\x63\137\x67\x61\164\x65\167\x61\x79\137\161\160\x61\171\x5f\x77\x65\x62\x68\157\x6f\x6b\x3f\157\162\144\145\x72\x5f\x69\144\x3d" . $order_id))));
                if (is_wp_error($responseCreate)) {
                    $error_message = $responseCreate->get_error_message();
                    echo "\123\x6f\x6d\x65\x74\x68\x69\156\147\40\167\x65\x6e\x74\x20\167\x72\157\156\147\x3a\40{$error_message}";
                } else {
                    $resCreate = json_decode($responseCreate["\142\157\x64\171"], true);
                    add_post_meta($order_id, "\161\x70\x61\x79\137\161\162\143\x6f\144\x65", $resCreate["\161\162\x5f\151\155\x61\147\x65"], true);
                    add_post_meta($order_id, "\x71\160\141\x79\137\x69\x6e\x76\x6f\x69\x63\145\137\x69\144", $resCreate["\151\x6e\x76\x6f\151\x63\145\137\x69\144"], true);
                    add_post_meta($order_id, "\x71\160\x61\x79\x5f\143\x61\154\154\142\141\143\153\137\165\162\x6c", get_site_url(null, "\x77\143\55\141\x70\151\57\x77\143\x5f\x67\x61\x74\145\x77\x61\x79\137\x71\160\141\171\137\167\x65\x62\150\157\157\x6b\x3f\x6f\x72\144\x65\162\137\x69\144\x3d" . $order_id), true);
                }
            }
            $body = "\x3c\150\164\155\154\76\x3c\142\157\144\x79\76\74\163\143\x72\x69\x70\x74\x20\x73\162\143\x3d\42\150\164\164\160\x73\x3a\57\57\x61\x6a\x61\170\x2e\147\157\x6f\x67\x6c\x65\141\x70\151\x73\x2e\143\157\x6d\57\141\152\x61\x78\57\154\151\x62\x73\x2f\152\161\x75\x65\162\171\57\63\x2e\x34\x2e\x31\57\152\161\165\145\162\171\56\155\x69\156\56\152\x73\42\76\74\x2f\163\143\162\x69\160\x74\76\74\x73\143\162\x69\x70\x74\76";
            $body .= "\x76\x61\x72\40\x64\151\166\x20\x3d\40\144\157\x63\x75\x6d\145\x6e\164\x2e\147\145\164\x45\154\145\x6d\x65\x6e\164\x73\102\171\103\154\141\x73\x73\x4e\141\155\x65\x28\42\x70\141\x79\x6d\x65\x6e\164\137\155\x65\x74\x68\157\144\137\x71\160\141\x79\x5f\147\141\164\x65\167\141\x79\x22\x29\133\x31\x5d\73";
            $body .= "\166\x61\162\40\x63\150\x69\154\x64\163\x20\x3d\40\144\x69\x76\x2e\143\x68\151\154\x64\162\x65\156\73";
            $body .= "\x76\x61\x72\40\x68\x6f\154\x64\x65\162\x20\x3d\40\144\x6f\143\165\x6d\145\x6e\164\56\x63\162\145\141\164\x65\105\154\145\155\x65\x6e\x74\x28\42\x64\151\166\x22\51\73";
            $body .= "\166\141\x72\40\151\155\147\x20\x3d\40\144\x6f\x63\165\155\145\x6e\x74\56\143\x72\145\141\x74\x65\105\154\145\155\x65\x6e\164\50\x22\151\x6d\x67\x22\51\x3b";
            $body .= "\166\141\x72\x20\160\x20\75\x20\x64\157\x63\x75\155\145\x6e\x74\56\x63\162\145\x61\x74\145\x45\x6c\145\155\145\156\164\x28\x22\x70\42\51\x3b";
            $body .= "\166\x61\162\x20\x77\141\x72\x6e\40\x3d\40\x64\x6f\x63\x75\x6d\145\x6e\x74\56\x63\x72\145\141\164\x65\105\154\x65\155\145\156\x74\50\x22\160\42\51\73";
            $body .= "\x76\141\162\x20\141\x20\75\x20\144\157\143\x75\155\x65\x6e\164\x2e\143\162\x65\141\x74\x65\105\x6c\145\x6d\x65\156\x74\50\x22\141\42\51\73";
            $body .= "\151\155\147\x2e\163\x65\x74\101\x74\164\162\x69\x62\x75\164\x65\50\x22\163\162\143\42\x2c\x20\x22\144\141\x74\x61\x3a\151\x6d\x61\x67\x65\57\160\x6e\x67\73\x62\x61\x73\145\x36\64\54" . $resCreate["\161\x72\137\151\155\x61\x67\145"] . "\42\x29\x3b";
            $body .= "\150\157\154\144\145\162\x2e\x63\154\x61\x73\x73\114\151\x73\164\56\x61\144\x64\x28\x22\x71\160\141\171\x5f\x68\x6f\154\144\x65\162\x22\51\73";
            $body .= "\x69\x6d\x67\56\x63\x6c\x61\163\x73\x4c\x69\163\164\56\141\144\144\x28\42\x71\x70\141\x79\55\x71\162\42\x29\x3b";
            $body .= "\167\141\x72\x6e\56\143\x6c\141\x73\x73\x4c\151\163\x74\x2e\x61\x64\x64\50\x22\x71\x70\x61\171\x2d\x77\x61\x72\156\x69\x6e\147\42\51\x3b";
            $body .= "\144\151\x76\56\x69\156\156\145\162\110\x54\115\x4c\40\75\x20\x22\x22\x3b";
            $body .= "\141\56\x69\156\x6e\x65\162\124\145\x78\x74\x20\75\x20\x22\320\245\xd1\x8d\xd1\x80\321\215\xd0\xb2\40\xd0\263\xd0\xb0\xd1\x80\40\321\x83\xd1\202\320\260\321\x81\xd0\275\320\260\320\260\xd1\201\x20\320\276\xd1\x80\320\xb6\x20\320\xb1\xd0\xb0\320\xb9\xd0\xb3\320\xb0\320\xb0\40\xd0\xb1\320\xbe\xd0\xbb\x20\xd1\x8d\xd0\275\320\xb4\40\320\264\320\260\xd1\x80\xd0\xb6\x20\320\261\320\260\xd0\275\320\272\320\xbd\321\213\40\xd0\260\320\277\320\xbf\x20\321\x81\xd0\xbe\320\275\xd0\263\xd0\276\xd0\275\320\276\x20\xd1\x83\xd1\x83\x21\42\73";
            $body .= "\141\x2e\x73\x65\x74\x41\164\164\x72\x69\x62\165\x74\145\50\42\150\162\x65\146\42\x2c\x20\42" . $resCreate["\x71\x50\141\x79\137\x73\x68\157\162\x74\125\162\154"] . "\42\x29\x3b";
            $body .= "\141\x2e\143\x6c\x61\163\163\x4c\151\163\x74\x2e\x61\x64\144\x28\x22\x71\160\x61\171\55\x6d\157\x62\151\x6c\x65\x2d\141\x70\160\55\154\x69\156\153\x73\x22\51\x3b";
            $body .= "\x70\x2e\151\x6e\156\145\162\x48\x54\115\x4c\40\75\40\42" . $this->description . "\x22\73";
            $body .= "\167\141\x72\156\x2e\151\x6e\x6e\x65\162\x48\124\115\114\x20\75\40\x22\xd0\242\xd3\251\320\xbb\320\261\xd3\251\xd1\200\x20\320\260\xd0\274\xd0\266\320\xb8\320\273\xd1\202\xd1\202\xd0\260\xd0\xb9\x20\xd1\x82\323\251\320\273\xd3\xa9\320\263\xd0\264\321\x81\xd3\xa9\320\275\320\270\320\xb9\40\xd0\xb4\320\260\321\200\320\xb0\xd0\260\x20\xd1\205\xd1\x83\xd1\x83\320\xb4\xd0\260\xd1\x81\40\xd0\xb0\xd0\262\321\202\xd0\xbe\320\xbc\320\xb0\321\x82\xd0\xb0\xd0\xb0\321\200\40\xd1\x88\320\270\320\xbb\320\xb6\320\xb8\xd0\xbd\xd1\x8d\41\x22\x3b";
            $body .= "\150\157\x6c\144\145\x72\56\141\160\160\x65\x6e\x64\x43\150\151\x6c\144\50\160\51\x3b";
            $body .= "\150\157\154\x64\145\x72\56\141\x70\x70\145\156\144\x43\x68\x69\154\144\x28\151\x6d\x67\51\x3b";
            if (wp_is_mobile()) {
                $body .= "\154\145\164\40\161\x70\141\171\x5f\x6d\x6f\x62\x69\154\145\x5f\144\x69\x76\x20\x3d\40\x64\157\x63\165\155\145\x6e\164\56\x63\162\x65\141\x74\145\105\x6c\145\155\x65\156\x74\50\42\144\x69\166\42\x29\73";
                $body .= "\x71\160\141\x79\x5f\155\x6f\142\x69\154\x65\x5f\144\x69\x76\x2e\x63\x6c\x61\163\163\x4c\151\x73\164\56\141\x64\x64\x28\x22\x71\160\141\171\x2d\x6d\x6f\142\x69\154\145\x2d\154\x69\x6e\x6b\55\143\x6f\x6e\x74\141\151\156\x65\162\x22\51\73";
                foreach ($resCreate["\x75\162\154\163"] as $k => $u) {
                    $body .= "\x6c\x65\x74\x20\155\137\151\x6d\147\x5f" . $k . "\40\75\x20\144\157\x63\165\155\145\x6e\x74\56\143\x72\x65\x61\164\145\105\x6c\x65\155\145\156\x74\x28\42\151\x6d\x67\42\51\73";
                    $body .= "\155\137\151\x6d\147\x5f" . $k . "\56\163\145\164\x41\x74\164\x72\x69\142\165\x74\x65\50\x22\x73\x72\x63\42\x2c\x20\x22" . $u["\x6c\x6f\x67\157"] . "\x22\x29\x3b";
                    $body .= "\x6d\x5f\151\155\147\137" . $k . "\x2e\163\145\x74\101\x74\164\x72\151\x62\165\164\145\50\x22\141\154\164\x22\54\x20\42" . $u["\144\x65\x73\x63\x72\151\x70\164\151\157\156"] . "\42\x29\73";
                    $body .= "\x6c\x65\x74\x20\155\x5f\141\137" . $k . "\x20\x3d\x20\144\x6f\143\165\155\145\156\x74\56\143\x72\x65\141\x74\x65\x45\154\x65\155\x65\156\x74\50\42\x61\42\51\x3b";
                    $body .= "\155\x5f\141\137" . $k . "\x2e\x73\145\x74\101\164\x74\x72\x69\142\x75\164\x65\50\42\x74\151\164\x6c\145\x22\x2c\x20\x22" . $u["\x64\145\163\x63\x72\x69\160\x74\x69\x6f\156"] . "\x22\51\73";
                    $body .= "\x6d\x5f\141\x5f" . $k . "\56\x73\145\x74\101\x74\164\x72\151\x62\165\x74\145\50\x22\150\162\x65\x66\x22\x2c\40\x22" . $u["\154\x69\x6e\x6b"] . "\42\51\73";
                    $body .= "\x6d\x5f\141\137" . $k . "\x2e\141\160\x70\x65\156\x64\x43\150\151\x6c\x64\50\x6d\137\151\155\x67\137" . $k . "\x29\x3b";
                    $body .= "\x71\160\x61\171\137\155\x6f\142\151\x6c\x65\x5f\144\151\x76\56\x61\x70\160\145\156\x64\103\150\151\154\144\50\x6d\x5f\x61\x5f" . $k . "\x29\73";
                }
                $body .= "\150\157\x6c\x64\145\162\x2e\x61\x70\160\x65\156\144\103\x68\x69\x6c\x64\50\x71\x70\x61\171\137\155\157\x62\151\154\145\x5f\144\151\x76\x29\x3b";
            }
            $body .= "\150\x6f\x6c\x64\145\162\x2e\x61\x70\160\145\x6e\x64\x43\x68\151\x6c\x64\50\x77\141\x72\156\x29\73";
            $body .= "\144\x69\166\x2e\x61\160\x70\145\x6e\144\103\150\151\154\144\50\x68\157\154\144\145\x72\x29\x3b";
            $body .= "\166\x61\162\x20\164\x69\155\x65\162\40\x3d\40\x73\145\164\x49\x6e\164\145\162\166\141\x6c\x28\50\x29\x3d\x3e\x7b\152\x51\165\145\162\x79\56\x61\152\141\x78\50\173\x75\162\154\x3a\40\x27\167\x63\55\x61\160\x69\57\127\x43\137\107\141\x74\x65\x77\x61\171\137\121\x70\x61\x79\47\x2c\164\171\160\145\72\x20\x22\107\105\124\x22\54\x64\x61\164\141\72\40\173\x69\156\166\157\x69\143\x65\111\x64\72\40\42" . $resCreate["\x69\x6e\166\x6f\x69\x63\x65\137\x69\144"] . "\x22\x2c\x20\x6f\162\144\145\162\x49\x64\72\x20" . $order_id . "\54\x20\x74\157\153\x65\156\72\40\x22" . $token . "\42\40\175\x2c\x64\141\x74\141\x54\x79\x70\145\72\40\x22\150\x74\155\154\x22\x2c\163\165\x63\143\x65\x73\163\x3a\40\x66\165\156\x63\164\151\x6f\x6e\x28\144\141\164\141\51\173\x76\x61\162\40\x64\164\141\40\x3d\40\x4a\123\117\x4e\x2e\x70\x61\162\163\145\50\144\141\164\141\x29\x3b\151\x66\x28\x64\x74\x61\x20\46\x26\40\x64\x74\x61\x2e\x72\x65\144\151\x72\x65\143\x74\51\173\x77\x69\156\144\157\167\56\154\x6f\143\141\x74\151\157\x6e\56\150\x72\145\146\x20\x3d\x20\144\x74\141\56\x72\x65\x64\x69\x72\145\143\164\73\40\143\x6c\145\x61\x72\111\x6e\164\x65\x72\x76\141\154\50\x74\x69\155\145\x72\x29\x3b\175\x3b\175\x2c\145\162\x72\157\162\x3a\x20\x66\x75\x6e\x63\x74\151\157\156\50\x6a\161\x58\x48\x52\54\x20\x65\x78\x63\145\x70\164\x69\x6f\156\51\x7b\175\x7d\x29\73\175\x2c\x31\60\x30\x30\x30\51\73";
            $body .= "\74\57\x73\143\162\x69\x70\x74\76\x3c\57\x62\157\144\171\x3e\74\x2f\x68\x74\x6d\154\76";
            $fr = array("\162\x65\x73\x75\154\164" => "\163\x75\x63\143\145\x73\x73", "\x71\120\x61\171\x5f\x51\x52\151\x6d\141\x67\145" => $resCreate["\161\x72\x5f\151\155\141\147\x65"], "\161\x50\x61\171\137\121\122\x63\x6f\x64\145" => $resCreate["\x71\x72\x5f\x74\x65\x78\x74"], "\x71\x50\141\171\137\x75\162\154" => $resCreate["\161\120\141\171\x5f\x73\x68\157\x72\x74\x55\x72\x6c"], "\151\156\166\x6f\151\143\x65\x5f\151\144" => $resCreate["\151\x6e\166\x6f\151\143\x65\137\151\x64"], "\x6f\x72\x64\x65\162\137\151\x64" => $order_id, "\155\145\163\x73\141\147\145\x73" => $body, "\162\145\163\x70\157\156\x73\145" => $responseCreate);
            if (!wp_doing_ajax()) {
                $fr["\162\x65\144\151\162\145\143\x74"] = wc_get_checkout_url();
            }
            return $fr;
        }
        public function qpay_response()
        {
            $responseCheck = wp_remote_post($this->merchant_url . "\x70\141\171\155\145\156\164\57\143\x68\x65\143\153", array("\150\145\141\144\145\x72\x73" => array("\x41\165\x74\x68\x6f\162\x69\172\x61\164\x69\157\156" => "\x42\x65\x61\162\145\x72\40" . $_GET["\164\x6f\153\145\156"]), "\x62\x6f\144\x79" => array("\x6f\x62\x6a\x65\143\x74\137\x74\x79\x70\x65" => "\x49\x4e\126\117\111\103\x45", "\x6f\x62\152\145\143\x74\x5f\151\144" => $_GET["\151\x6e\166\x6f\151\143\145\111\144"], "\157\x66\x66\163\145\x74" => array("\160\141\147\x65\137\156\165\155\x62\x65\162" => 1, "\160\141\147\145\x5f\154\x69\x6d\x69\164" => 100))));
            $order = wc_get_order($_GET["\157\x72\x64\145\x72\111\x64"]);
            if (is_wp_error($responseCheck)) {
                $error_message = $responseCheck->get_error_message();
                echo "\123\157\x6d\x65\x74\x68\x69\156\x67\x20\167\x65\x6e\x74\40\167\x72\x6f\x6e\147\72\40{$error_message}";
            } else {
                $resCheck = json_decode($responseCheck["\142\x6f\x64\171"], true);
                if (isset($resCheck["\160\x61\151\x64\137\141\155\x6f\x75\156\x74"]) && intval($resCheck["\x70\141\x69\x64\137\141\155\157\165\x6e\x74"]) >= intval($order->get_total()) && intval($resCheck["\143\x6f\x75\x6e\164"]) > 0 && count($resCheck["\162\x6f\x77\x73"]) > 0) {
                    add_post_meta($_GET["\x6f\x72\x64\145\162\x49\144"], "\161\160\x61\x79\137\162\x65\163\160\x6f\156\163\x65", json_encode($responseCheck["\x62\x6f\144\171"]));
                    $order->payment_complete();
                    return wp_send_json(array("\162\145\144\x69\x72\145\143\x74" => get_home_url() . "\x2f\143\150\x65\x63\x6b\157\165\x74\57\157\162\144\145\162\55\x72\x65\x63\145\x69\166\x65\144\57" . $_GET["\157\162\x64\145\x72\111\x64"] . "\77\x6b\x65\171\75" . $order->get_order_key() . ''));
                } else {
                    if (isset($resCheck["\145\x72\162\157\x72"]) && $resCheck["\145\x72\162\157\162"] == "\116\117\137\103\x52\105\x44\x45\x4e\x44\111\x41\x4c\x53") {
                        $token = $this->get_qpay_token();
                        if ($token) {
                            $responseCheck = wp_remote_post($this->merchant_url . "\160\141\x79\x6d\145\156\x74\57\143\150\x65\143\x6b", array("\150\145\141\x64\145\x72\163" => array("\101\165\x74\x68\157\162\x69\172\141\164\x69\x6f\x6e" => "\102\145\141\162\x65\162\x20" . $token), "\142\x6f\x64\x79" => array("\x6f\142\x6a\145\143\164\137\x74\x79\160\x65" => "\x49\x4e\126\x4f\x49\103\x45", "\x6f\142\x6a\145\143\164\137\151\x64" => $_GET["\151\156\x76\157\151\x63\145\x49\144"], "\157\x66\x66\x73\145\164" => array("\160\x61\x67\145\x5f\156\x75\155\142\x65\162" => 1, "\160\x61\147\x65\x5f\x6c\151\x6d\151\x74" => 100))));
                            if (is_wp_error($responseCheck)) {
                                $error_message = $responseCheck->get_error_message();
                                echo "\x53\157\x6d\x65\x74\x68\151\156\x67\40\167\145\x6e\164\x20\167\162\x6f\x6e\x67\x3a\40{$error_message}";
                            } else {
                                $resCheck = json_decode($responseCheck["\x62\157\144\x79"], true);
                                if (isset($resCheck["\x70\141\x69\x64\x5f\141\155\157\165\156\x74"]) && intval($resCheck["\160\141\151\x64\x5f\141\155\157\165\156\164"]) >= intval($order->get_total()) && intval($resCheck["\x63\x6f\x75\156\x74"]) > 0 && count($resCheck["\162\157\x77\163"]) > 0) {
                                    add_post_meta($_GET["\x6f\162\144\145\162\x49\144"], "\161\160\141\x79\x5f\x72\x65\x73\160\x6f\x6e\x73\x65", json_encode($responseCheck["\142\x6f\x64\x79"]));
                                    $order->payment_complete();
                                    return wp_send_json(array("\x72\x65\x64\151\x72\145\x63\164" => get_home_url() . "\57\143\150\x65\x63\x6b\157\x75\x74\57\157\162\144\x65\162\55\162\145\x63\x65\151\x76\x65\144\57" . $_GET["\157\162\x64\x65\x72\111\x64"] . "\77\153\x65\x79\x3d" . $order->get_order_key() . ''));
                                }
                            }
                        }
                    }
                }
            }
            return wp_send_json_error(array());
        }
        private function get_qpay_token()
        {
            $response = wp_remote_post($this->merchant_url . "\x61\165\164\150\x2f\x74\x6f\x6b\145\x6e", array("\150\145\141\x64\145\162\x73" => array("\x41\165\164\x68\x6f\x72\x69\172\x61\x74\151\x6f\156" => "\102\141\x73\x69\x63\40" . base64_encode($this->merchant_username . "\72" . $this->merchant_password))));
            if (is_wp_error($response)) {
                $error_message = $response->get_error_message();
                wp_die("\123\157\155\x65\164\x68\151\x6e\147\x20\x77\145\x6e\164\40\x77\x72\x6f\156\147\x3a\40" . $error_message);
            } else {
                $res_arr = json_decode($response["\x62\157\x64\x79"], true);
                return $res_arr["\141\x63\x63\145\x73\163\x5f\164\157\x6b\145\156"];
            }
            return false;
        }
        public function qpay_response_webhook()
        {
            if (empty($_GET["\x6f\x72\144\145\x72\x5f\x69\x64"])) {
                die("\173\x22\x73\x75\143\143\x65\x73\163\x22\72\x22\x65\155\160\164\x79\x22\x7d");
            }
            $invoice_id = get_post_meta($_GET["\x6f\162\x64\x65\x72\x5f\x69\x64"], "\x71\160\141\x79\x5f\151\156\x76\157\151\x63\x65\137\151\x64", true);
            $token = $this->get_qpay_token();
            if ($token) {
                $responseCheck = wp_remote_post($this->merchant_url . "\160\141\171\x6d\x65\156\164\x2f\143\150\x65\143\x6b", array("\150\145\141\144\145\x72\163" => array("\x41\165\x74\150\x6f\162\x69\x7a\x61\x74\151\x6f\156" => "\x42\x65\x61\x72\145\162\x20" . $token), "\x62\157\x64\x79" => array("\157\x62\x6a\x65\x63\x74\x5f\164\x79\160\x65" => "\111\x4e\x56\x4f\x49\x43\x45", "\157\142\152\145\x63\164\137\151\x64" => $invoice_id, "\157\x66\146\x73\145\x74" => array("\x70\x61\x67\145\137\x6e\165\155\x62\145\x72" => 1, "\160\x61\x67\145\137\x6c\x69\x6d\x69\x74" => 100))));
                if (is_wp_error($responseCheck)) {
                    $error_message = $responseCheck->get_error_message();
                    wp_die("\x53\157\155\145\x74\150\151\x6e\x67\x20\167\145\x6e\x74\40\167\162\x6f\x6e\147\x3a\x20" . $error_message);
                } else {
                    $resCheck = json_decode($responseCheck["\142\x6f\144\x79"], true);
                    $order = wc_get_order($_GET["\x6f\x72\144\145\x72\x5f\151\144"]);
                    if (intval($resCheck["\160\141\x69\144\137\x61\x6d\x6f\165\156\164"]) >= intval($order->get_total()) && intval($resCheck["\143\x6f\x75\156\164"]) > 0 && count($resCheck["\x72\x6f\167\163"]) > 0) {
                        $order->payment_complete();
                        die("\173\42\x73\165\143\143\145\163\163\x22\x3a\x74\x72\x75\x65\x7d");
                    }
                }
            }
            die("\173\x22\x73\x75\143\143\x65\163\163\42\x3a\146\x61\x6c\163\x65\175");
        }
        public function qpay_scripts()
        {
            wp_enqueue_style("\161\x70\x61\171\55\143\x73\x73", plugin_dir_url(__FILE__) . "\x73\164\x79\x6c\x65\56\143\x73\163", '', '', "\x73\x63\x72\x65\145\x6e");
        }
    }
}

Function Calls

None

Variables

None

Stats

MD5 ab8fb3e8f85f407584d954f472caf45b
Eval Count 0
Decode Time 57 ms