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 /* * @version $Id: Pont V7.6 2021-10-23 szathmari.hu $ * @copyright Copy..
Decoded Output download
<?php
/*
* @version $Id: Pont V7.6 2021-10-23 szathmari.hu $
* @copyright Copyright (C) 2021 szathmari.hu - All rights reserved.
* @license commerical
* @url https://szathmari.hu
*/
goto UtwY_; UtwY_: class posta { public $acc; public $key; public $secret; public $access_token; public $test; public $parcel; function init() { goto tO0Pc; D1Mz5: WDkQ6: goto ytaMV; ABHQq: $this->acc = get_option("wc_pont_posta_acc"); goto D1Mz5; XN6JX: $this->env = get_option("wc_pont_posta_test") === "yes" ? "sandbox" : "core"; goto WEeUo; G76Nv: $this->secret = get_option("wc_pont_posta_secret"); goto XN6JX; ytaMV: $this->key = get_option("wc_pont_posta_key"); goto G76Nv; tO0Pc: if (empty(get_option("wc_pont_posta_acc"))) { goto WDkQ6; } goto ABHQq; WEeUo: } function get_access() { goto Ny2jN; NU0sf: cgRTn: goto btdst; LU7Cr: WC_Pont::log("Export:\x9Posta hiba" . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "error"); goto z3JuN; z3JuN: WC_Pont::st_array("pont_errors", "Posta", __("Kapcsol\xc3\263d\303\241si probl\xc3\251ma", "wc-pont") . ": " . json_encode($resp->errors)); goto OTb8q; wm_mS: return; goto jd36s; ceIYN: $this->access_token = $token; goto gpxN8; ANpLZ: WC_Pont::log("Export: Posta hiteles\xc3\xadt\303\251s sikertelen" . " response: " . $resp["body"], "error"); goto KVhmF; cOx4l: $params = array("timeout" => 10, "httpversion" => "1.1", "body" => ["grant_type" => "client_credentials"], "Accept" => "application/json", "Content-Type" => "application/json", "headers" => ["Authorization" => "Basic " . base64_encode($this->key . ":" . $this->secret)]); goto qhp47; Ny2jN: $token = get_transient("pont_posta_token"); goto ErBYg; gpxN8: WC_Pont::log("Posta\x9Access by stored token", "info"); goto wm_mS; qhp47: $resp = wp_remote_post("https://" . $this->env . ".api.posta.hu/oauth2/token", http_build_query($params)); goto aW783; btdst: $resp = json_decode(wp_remote_retrieve_body($resp)); goto l4xuh; pl3Mg: WC_Pont::log("Export: oauth2" . " resp code: " . $respcode . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "info"); goto iGkRV; CW5y8: if (400 <= $respcode) { goto CMoNr; } goto pl3Mg; M3J_8: set_transient("pont_posta_token", $resp->access_token, 15 * MINUTE_IN_SECONDS); goto F0lB_; l4xuh: $this->access_token = $resp->access_token; goto M3J_8; aW783: if (!is_wp_error($resp)) { goto v9mN8; } goto LU7Cr; ErBYg: if (!$token) { goto XhH0P; } goto ceIYN; jd36s: XhH0P: goto cOx4l; psiID: $respcode = wp_remote_retrieve_response_code($resp); goto CW5y8; KVhmF: WC_Pont::st_array("pont_errors", "Posta", __("Hiteles\xc3\xadt\xc3\251si probl\xc3\xa9ma", "wc-pont")); goto o0thE; zRzpy: v9mN8: goto psiID; Cmz0d: CMoNr: goto ANpLZ; o0thE: return; goto NU0sf; OTb8q: return false; goto zRzpy; iGkRV: goto cgRTn; goto Cmz0d; F0lB_: } function setDOP($order, $order_id, $pont) { goto c0p0I; WHjOe: fpbih: goto N5xHL; AJxHM: nWNUj: goto BnfUw; eKZtK: $this->parcel->recipient->address->parcelPickupSite = $p[$id]["name"]; goto Khex6; BnfUw: if (!empty($p)) { goto cRjH0; } goto Vo9KQ; Fk6rf: b9c3w: goto PLHkT; Khex6: return true; goto WHjOe; uV1hD: $pp[] = json_decode(@file_get_contents(WC_Pont::$plugin_path . "postacspont.json"), true); goto DuQ1q; Vo9KQ: return false; goto HyEkS; D30k5: $this->parcel->item[0]->services->deliveryMode = $p[$id]["group"]; goto eKZtK; PLHkT: if (!is_array($p[$id])) { goto fpbih; } goto D30k5; HyEkS: cRjH0: goto MGKkY; MGKkY: $id = array_search($pont[2], array_column($p, "id")); goto wIJjQ; GOq7N: $pp[] = json_decode(@file_get_contents(WC_Pont::$plugin_path . "postappont.json"), true); goto uV1hD; wIJjQ: if (!($id === false)) { goto b9c3w; } goto vkJ_F; c0p0I: $pp[] = json_decode(@file_get_contents(WC_Pont::$plugin_path . "postampont.json"), true); goto GOq7N; DuQ1q: $p = []; goto IQk_u; IQk_u: foreach ($pp as $t) { goto DTz0E; SpAU3: $p = array_merge($p, $t); goto F312v; e7KQo: Cktud: goto edack; DTz0E: if (!is_array($t)) { goto HnX0w; } goto SpAU3; F312v: HnX0w: goto e7KQo; edack: } goto AJxHM; vkJ_F: return false; goto Fk6rf; N5xHL: } } goto ZERF_; E9yqE: function delete_posta_package($pns) { goto BypVd; BypVd: WC_Pont::log("Posta\x9delete shipments", "info"); goto sUKoR; NaVgJ: $csomag->init(); goto xFL7G; DiTCe: xJioC: goto x3lNV; A7Nyu: $t = []; goto xTdub; x3lNV: return $t; goto f4kka; xTdub: foreach ($pns as $pn) { goto Rcmvx; pxZUZ: $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); goto tmUFp; T0enV: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); goto K2rsS; Httj9: WC_Pont::log("Posta delete: " . json_encode($result, JSON_UNESCAPED_UNICODE), "error"); goto Hurrv; IVI5H: curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); goto qA8Pz; AD30V: $t[$pn] = __("T\303\266r\303\266lve", "wc-pont"); goto Ny7ha; Hurrv: TDRC4: goto t5vvm; lRC1D: curl_close($ch); goto ZGl_p; PWJyY: curl_setopt($ch, CURLOPT_HEADER, TRUE); goto IVI5H; Xttkx: curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE); goto PWJyY; Rcmvx: $url = "https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/" . $pn; goto lFz3k; hoVG7: $t[$pn] = __("Hibak\xc3\xb3d", "wc-pont") . ": " . implode(", ", $e); goto Httj9; tmUFp: $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE)); goto xqh_Q; K2rsS: curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); goto Xttkx; jPXTF: $headers = ["Accept: application/json", "Content-Type: application/json; charset=utf-8", "X-Request-Id: " . get_uuid(), "X-Accounting-Code: " . $csomag->acc, "Authorization: Bearer " . $csomag->access_token]; goto Fv0n5; yClSn: goto Kgj7d; goto pEzwy; Fv0n5: $ch = curl_init(); goto lOj50; N8vVx: $t[$pn] = __("Hiba", "wc-pont") . ": " . $httpcode; goto yClSn; t5vvm: Kgj7d: goto PJM83; PJM83: gRgZT: goto a52gy; oFTBX: if (isset($result->errors)) { goto xLcgg; } goto AD30V; JC9uc: if (200 == $httpcode) { goto RWBH5; } goto N8vVx; qA8Pz: $response = curl_exec($ch); goto pxZUZ; xqh_Q: $result = json_decode($body); goto lRC1D; HKZPH: $e = array_column($result->errors, "code"); goto hoVG7; pEzwy: RWBH5: goto oFTBX; lFz3k: $params = array("timeout" => 10, "httpversion" => "1.1", "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto jPXTF; z6RRR: xLcgg: goto HKZPH; ZGl_p: WC_Pont::log("Posta\x9delete: " . " TR: " . $pn . " result: " . wc_print_r($response, true) . " body: " . $body, "info"); goto JC9uc; lqJgH: curl_setopt($ch, CURLOPT_URL, $url); goto S3aep; S3aep: curl_setopt($ch, CURLOPT_TIMEOUT, 10); goto T0enV; Ny7ha: goto TDRC4; goto z6RRR; lOj50: curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); goto lqJgH; a52gy: } goto DiTCe; xFL7G: $csomag->get_access(); goto A7Nyu; sUKoR: $csomag = new posta(); goto NaVgJ; f4kka: } goto c1Yzg; Ft8km: function check_response($resp, $order_id) { goto TjXo_; oJjpQ: return $respcode; goto rBuQe; ZADDX: WC_Pont::log("Posta response: " . json_encode(array($resp), JSON_UNESCAPED_UNICODE), "error"); goto dSphf; dSphf: WC_Pont::st_array("pont_errors", $order_id, sprintf("%s: %s, hibale\303\255r\xc3\241s: %s", __("Hiba t\xc3\266rt\303\251nt. MPL \xc3\241ltal k\303\274ld\xc3\266tt hibak\xc3\xb3d", "wc-pont"), $respcode, wp_remote_retrieve_response_message($resp))); goto JYJ3U; TjXo_: $respcode = wp_remote_retrieve_response_code($resp); goto agYfa; agYfa: if (!(200 != $respcode)) { goto cwdu5; } goto ZADDX; JYJ3U: cwdu5: goto oJjpQ; rBuQe: } goto BND_5; qI5y2: function get_uuid() { goto qxUYH; v5Y9N: return vsprintf("%s%s-%s-%s-%s-%s%s%s", str_split(bin2hex($data), 4)); goto mdtZ_; QFrUo: $data[6] = chr(ord($data[6]) & 0xf | 0x40); goto phZid; qxUYH: $data = random_bytes(16); goto QFrUo; phZid: $data[8] = chr(ord($data[8]) & 0x3f | 0x80); goto v5Y9N; mdtZ_: } goto Ft8km; BND_5: function remark_on_label($order, $template, $length = null) { goto Hq1Km; wbcgl: if (!(sizeof($iTemplate) > 0)) { goto PvfcU; } goto LZE6Y; Fjlry: PvfcU: goto lVMjC; QI2A7: return mb_substr($template, 0, $length ?? 40); goto Nf1SY; p0aIr: $order_id = $order->get_order_number(); goto nL0wl; Ut0aX: $iTemplate = array(); goto SqOdL; lVMjC: $template .= " " . implode("|", $itemTemplate); goto QI2A7; fox8I: ECRFq: goto wQRHP; aLPmz: foreach ($lItems as $k => $lItem) { goto QyKC0; IWM0C: $iTemplate[] = " " . $k . $lItem; goto s1CLQ; dTv1T: $template = str_replace($lItem, " ", $template); goto IWM0C; s1CLQ: mAtgn: goto s_W10; s_W10: Eg0g8: goto evgmc; QyKC0: if (!(strpos($template, $lItem) !== false)) { goto mAtgn; } goto dTv1T; evgmc: } goto fox8I; nL0wl: $templateRep = array("[megjegyz\xc3\xa9s]" => $customer_message, "[\303\xbajsor]" => "\xa", "[rendel\303\251ssz\xc3\xa1m]" => $order_id); goto zOQJ_; wQRHP: $contents = get_contents($order); goto wbcgl; cavar: $lItems = array("#" => "[cikksz\xc3\xa1m]", '' => "[term\303\xa9k]", "db: " => "[mennyis\303\251g]"); goto Ut0aX; LZE6Y: foreach ($contents as $content) { $itemTemplate[] = strtr(implode(" ", $iTemplate), array("[term\xc3\xa9k]" => $content["name"], "[cikksz\303\241m]" => $content["sku"], "[mennyis\303\251g]" => $content["qty"])); JSlfM: } goto XY9vp; XY9vp: MmY8S: goto Fjlry; Hq1Km: $customer_message = !empty($order->get_customer_note()) ? $order->get_customer_note() : ''; goto cavar; zOQJ_: $template = strtr($template, $templateRep); goto aLPmz; SqOdL: $itemTemplate = array(); goto p0aIr; Nf1SY: } goto m4XUA; MXLO2: function get_posta_shipments($pn = null) { goto mhui1; RIQvr: foreach ($resp as $r) { goto PrQEe; PrQEe: $packages = null; goto p1I1B; FbeLF: $address = $r->shipment->recipient->address; goto IWV0x; AFZId: RcJg3: goto jpXbF; VaE5x: j69JM: goto FbeLF; F2r4N: $table->parcels[] = array("pn" => sprintf("%s <a href="%s" class="your-class">%s</a>", $r->shipment->trackingNumber, $delete_url, __("T\xc3\xb6r\xc3\266l", "wc-pont")), "date" => date("Y-m-d H:i", strtotime($r->shipment->shipmentDate)), "order_id" => $r->shipment->orderId, "recipient_name" => $r->shipment->recipient->contact->name, "recipient_contact" => $r->shipment->recipient->contact->email . " " . $r->shipment->recipient->contact->phone, "recipient_address" => sprintf("%s %s, %s", $address->postCode, $address->city, $address->address), "items" => $packages); goto AFZId; p1I1B: foreach ($r->shipment->item as $i) { goto LcwZE; JfLnX: $packages = sprintf("m\xc3\251ret: <b>%s</b> egy\xc3\xa9ni 1: <b>%s</b> egy\xc3\251ni 2: <b>%s</b> ut\xc3\241nv\303\251t: <b>%s</b> szolg\303\xa1ltat\xc3\xa1s: <b>%s</b> extra: <b>%s</b> k\xc3\xa9zbes\xc3\xadt\303\xa9s: <b>%s</b> d\303\255j: <b>%s</b> ut\303\241nv\xc3\xa9t: <b>%s</b>", $i->size, $i->customData1 ?? '', $i->customData2 ?? '', $i->services->cod, $i->services->basic, $extra, $i->services->deliveryMode ?? '', $i->fee ?? "-", $i->services->cod ?? "-"); goto CDCZV; LcwZE: $extra = implode(", ", $i->services->extra); goto JfLnX; CDCZV: CHuRm: goto wIRn3; wIRn3: } goto VaE5x; IWV0x: $delete_url = wp_nonce_url(add_query_arg(array("pn" => array($r->shipment->trackingNumber)), admin_url("admin.php?page=posta")), "postapage", "_wpnonce"); goto F2r4N; jpXbF: } goto e5Tmv; h7KG3: $respcode = wp_remote_retrieve_response_code($resp); goto iyUer; Y6zHq: $csomag->init(); goto mroYI; GBx4p: NuEuh: goto MlLFp; ZgD3D: $csomag = new posta(); goto Y6zHq; HUTry: $limit = filter_input(INPUT_GET, "limit", FILTER_VALIDATE_INT); goto xJk9T; PTrq0: $resp = wp_remote_get($url, $params); goto h7KG3; LjQr0: return count($resp); goto DXVqr; xJk9T: if (!$limit) { goto ryE_F; } goto Zskeb; PcqQH: return null; goto GBx4p; MSIWk: ryE_F: goto obCma; Zskeb: $table->pagination = $limit; goto MSIWk; iyUer: if (!(200 != $respcode)) { goto NuEuh; } goto EitcT; e5Tmv: pOZ57: goto HUTry; EitcT: WC_Pont::log("Posta\x9response: " . json_encode(array($resp), JSON_UNESCAPED_UNICODE), "error"); goto PcqQH; MlLFp: $resp = json_decode(wp_remote_retrieve_body($resp)); goto w3xq1; obCma: $table->prepare_items(); goto afpuM; mhui1: WC_Pont::log("Posta\x9get shipments", "info"); goto ZgD3D; mroYI: $csomag->get_access(); goto xlDX6; afpuM: $table->display(); goto LjQr0; pfrYM: $params = array("timeout" => 20, "httpversion" => "1.1", "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto PTrq0; xlDX6: $url = "https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/"; goto pfrYM; w3xq1: $table = new shipments_table(); goto RIQvr; DXVqr: } goto E9yqE; ZERF_: function export_posta($order_ids) { goto uxCII; ChaIy: $trs = []; goto CSfde; H7bIi: $resp = wp_remote_post("https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments", $query); goto o5DpY; uxCII: $csomag = new posta(); goto DApIi; hh1d3: WC_Pont::st_array("pont_errors", $order_id, __("C\303\xadmkenyomtatat\303\xa1si probl\xc3\xa9ma", "wc-pont") . ": " . json_encode($resp)); goto F81bS; g5YnL: xIU4Y: goto PifFg; IWl1N: return; goto kPNts; b_jup: WC_Pont::st_array("pont_errors", 0, __("C\xc3\255mkelekelet\xc3\266lt\xc3\251si probl\xc3\xa9ma:", "wc-pont") . ": " . json_encode($resp)); goto ZDagh; HF9o9: foreach ($trs as $o_id => $tr) { WC_Pont::st_array("pont_pdf", $o_id, $filename); xovJX: } goto F2pUq; sKlgk: if (!is_wp_error($resp)) { goto YtfHO; } goto b_jup; O8hHJ: $query = "trackingNumbers=" . implode("&trackingNumbers=", $trs); goto tqxYP; LEeoz: file_put_contents(trailingslashit(WC_Pont::wc_pont_upload_dir()) . $filename, base64_decode($resp[0]->label)); goto HF9o9; F81bS: return; goto hSI2S; SmIji: WC_Pont::log("Export:\x9Parcel print" . " order id: " . implode(", ", $exported_ids) . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "error"); goto hh1d3; Lfyl4: b_I1x: goto HdK0p; IkQ3d: $csomag->get_access(); goto Z5jFu; ZdBA7: H05In: goto O1GOj; tbBRp: WC_Pont::log("Export:\x9Parcel print" . " order id: " . implode(", ", $exported_ids) . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "info"); goto dzHma; kxLsw: foreach ($order_ids as $order_id) { goto wgKNi; Vwwby: $csomag->parcel->item[0] = $item; goto v1GuT; T9eY7: goto ulTla; goto D9knW; SuwdT: if (!$pont) { goto A2Ewc; } goto je5Jm; FqIqh: $csomag->parcel->recipient = $recipient; goto ntfaR; zQMqW: $value = !empty($max_value) && is_numeric($max_value) && $order->get_total() > $max_value ? $max_value : $order->get_total(); goto MEoE4; gorAC: $custom_data1 = remark_on_label($order, $template); goto P2AWt; b622v: WC_Pont::st_array("pont_errors", $order->get_order_number(), sprintf(__("A rendel\303\xa9s nem lett export\303\241lva, %s meta alapj\xc3\241n kiz\303\241rva", "wc-pont"), $exclude)); goto AE1v8; Lkb5O: if (!("cod" === $order->get_payment_method())) { goto ZIPvi; } goto PaU19; oNo4A: $item->services->extra[] = "K_UVT"; goto nnLj9; XSS1r: $template = get_option("wc_pont_posta_remark_template"); goto agGhK; T5LjC: PME7p: goto mkIsl; Wg_8x: if (empty($template)) { goto cV48v; } goto gorAC; je5Jm: $p = explode("|", $pont); goto p2656; N8xFo: goto ulTla; goto mZbhY; NpPay: $custom_data2 = ''; goto U8Ra1; AnXW8: if (!($exclude && get_post_meta($order_id, $exclude))) { goto yZnrb; } goto b622v; EQXEm: if (!(strpos($sMethod["method_id"], "local_pickup") !== false)) { goto ydWtq; } goto r8bCa; mYG3M: WC_Pont::log("Export:\x9Parcel done" . " order id: " . $order_id . " parcel: " . wc_print_r($csomag->parcel, true), "info"); goto wR98L; mkIsl: $exclude = get_option("wc_pont_posta_exclude"); goto AnXW8; JXaNc: VCbJr: goto JlXl5; vJmIW: if (empty($template)) { goto z2oka; } goto Z7qby; acUqu: A2Ewc: goto JL21g; JlXl5: $max_value = get_option("wc_pont_posta_max_value"); goto zQMqW; l904b: EKjow: goto acUqu; ntfaR: $template = get_option("wc_pont_posta_custom_data1_template"); goto EhanR; T0CJa: $recipient = (object) ["contact" => (object) ["name" => trim($order->get_shipping_company() . " " . $order->get_shipping_last_name() . " " . $order->get_shipping_first_name()), "email" => $order->get_billing_email(), "phone" => get_option("wc_pont_posta_format_phone") === "yes" ? substr(formatPhone($order->get_billing_phone()), 0, 13) : $order->get_billing_phone()], "address" => (object) ["postCode" => $order->get_shipping_postcode(), "city" => $order->get_shipping_city(), "address" => @$order->get_shipping_address_2() ? $order->get_shipping_address_1() . " " . $order->get_shipping_address_2() : $order->get_shipping_address_1(), "parcelPickupSite" => '', "remark" => $remark]]; goto FqIqh; PaU19: $item->services->cod = (float) $order->get_total(); goto oNo4A; S5nOy: $item->size = empty(get_post_meta($order_id, "package_size")) ? get_option("wc_pont_posta_size", "M") : get_post_meta($order_id, "package_size", true); goto M92c2; ml4dP: if (!(false === $dop)) { goto LHoV9; } goto Zl57Z; GjX5H: if (!($services && is_array($services))) { goto PME7p; } goto rN5Dq; sYCpg: $custom_data2 = remark_on_label($order, $template); goto JXaNc; sn741: $exp++; goto GMbrb; ekQrL: $order = new WC_Order($order_id); goto W9KKz; D9knW: LHoV9: goto l904b; GMbrb: ulTla: goto VKGrE; P2AWt: cV48v: goto TqlBi; Zl57Z: WC_Pont::st_array("pont_errors", $order->get_order_number(), __("\303\x81tvev\xc5\221pont nem tal\xc3\241lhat\303\263:", "wc-pont") . " " . $p[2]); goto T9eY7; W9KKz: $sMethod = $order->get_shipping_methods(); goto dTJx2; r8bCa: WC_Pont::st_array("pont_errors", $order->get_order_number(), __("Rendel\xc3\251s nem ker\xc3\xbclt tov\303\241bb\xc3\xadt\303\xa1sra, szem\303\251lyes \303\241tv\xc3\xa9tellel k\303\251rte", "wc-pont")); goto N8xFo; v1GuT: $pont = get_post_meta($order_id, "wc_selected_pont", true); goto SuwdT; sVsF0: goto ulTla; goto p2yzF; wsMgl: WC_Pont::st_array("pont_errors", $order->get_order_number(), sprintf(__("A rendel\303\xa9st %s sz\303\241ll\303\xadt\303\241ssal k\xc3\251rte", "wc-pont"), $p[1])); goto sVsF0; MEoE4: $item = (object) ["customData1" => $custom_data1, "customData2" => $custom_data2, "weight" => ["value" => WC_Pont::get_package_weight($order), "unit" => "g"], "size" => "M", "services" => (object) ["basic" => "A_175_UZL", "extra" => [], "cod" => 0, "value" => (float) $value, "deliveryMode" => "HA"]]; goto S5nOy; rN5Dq: $item->services->extra = array_merge($item->services->extra, $services); goto T5LjC; wgKNi: $csomag->parcel = (object) ["sender" => ["agreement" => get_option("wc_pont_posta_agreement"), "accountNo" => (string) get_option("wc_pont_posta_account_no"), "contact" => ["name" => get_option("wc_pont_posta_sender_name"), "email" => get_option("wc_pont_posta_sender_mail"), "phone" => get_option("wc_pont_posta_sender_phone")], "address" => ["postCode" => get_option("wc_pont_posta_sender_zip"), "city" => get_option("wc_pont_posta_sender_city"), "address" => get_option("wc_pont_posta_sender_address"), "remark" => '']], "recipient" => (object) ["contact" => (object) ["name" => '', "email" => '', "phone" => ''], "address" => (object) ["postCode" => '', "city" => '', "address" => '', "parcelPickupSite" => '', "remark" => ''], "disabled" => false], "orderId" => (string) $order_id, "developer" => "szathmari.hu", "webshopId" => get_option("wc_pont_posta_sender_name"), "labelType" => get_option("wc_pont_posta_labeltype", "A5"), "tag" => '', "paymentMode" => get_option("wc_pont_posta_payment_mode", "UV_AT"), "packageRetention" => (int) get_option("wc_pont_posta_retention", "5"), "item" => []]; goto ekQrL; M92c2: $services = get_option("wc_pont_posta_service_extra"); goto GjX5H; U8Ra1: if (empty($template)) { goto VCbJr; } goto sYCpg; icaio: $dop = $csomag->setDOP($order, $order_id, $p); goto ml4dP; w_P5g: z2oka: goto T0CJa; dTJx2: $sMethod = reset($sMethod); goto EQXEm; wR98L: $parcels[] = $csomag->parcel; goto sn741; p2656: if (strpos($p[1], "Posta") !== false) { goto zq_3M; } goto wsMgl; nnLj9: ZIPvi: goto Vwwby; EhanR: $custom_data1 = ''; goto Wg_8x; p2yzF: goto EKjow; goto JneiR; Z7qby: $remark = remark_on_label($order, $template, 50); goto w_P5g; mZbhY: ydWtq: goto XSS1r; JL21g: do_action("woocommerce_" . "wc_pont" . "_export_posta_data", $csomag->parcel, $order); goto mYG3M; h3Ong: yZnrb: goto Lkb5O; JneiR: zq_3M: goto icaio; TqlBi: $template = get_option("wc_pont_posta_custom_data2_template"); goto NpPay; AE1v8: goto ulTla; goto h3Ong; agGhK: $remark = ''; goto vJmIW; VKGrE: } goto Lfyl4; AepFN: $query = http_build_query($params); goto H7bIi; aEHe0: WC_Pont::log("Posta data" . " X-Accounting-Code: " . $csomag->acc . " send: " . json_encode($parcels, JSON_UNESCAPED_UNICODE), "info"); goto TFNTH; ZMXei: $resp = wp_remote_get($url, $params); goto qnUcJ; WU6ri: $resp = json_decode(wp_remote_retrieve_body($resp)); goto tbBRp; TelN0: if (!(get_option("wc_pont_export_mod_status") == "yes")) { goto GWm_q; } goto ilyZS; X7WDg: posta_shipments_close(); goto zzRl9; iESFq: $resp = json_decode(wp_remote_retrieve_body($resp)); goto hBbUL; PifFg: set_transient("pont_carrier", "posta", 5 * MINUTE_IN_SECONDS); goto TelN0; Kq9JB: if (!is_wp_error($resp)) { goto bwzfn; } goto SmIji; HdK0p: $exported_ids = array_column($parcels, "orderId"); goto PZrzg; kPNts: m1KqE: goto Kq9JB; zzRl9: return count(get_transient("pont_pcls")); goto hgXoL; hBbUL: $filename = date("Ymd-His") . ".pdf"; goto LEeoz; lrmvF: AgEL2: goto sKlgk; F2pUq: TLMdQ: goto g5YnL; q2b13: $body = "\xa{
"fromDate": "2020-07-23T12:31:05.851Z",
"toDate": "2020-07-23T12:31:05.851Z",
"trackingNumbers": [
"PNVF195161001"\xa],
"checkList": true,\xa"tag": "string"
}\xa"; goto X7WDg; cBay1: $parcels = []; goto kxLsw; o5DpY: WC_Pont::log("Posta\x9sent query: " . json_encode($query, JSON_UNESCAPED_UNICODE), "info"); goto DXsdG; YLnIK: WC_Pont::log("Export: get labels" . " tr: " . implode(", ", $trs) . " url: " . $url, "info"); goto ZMXei; tqxYP: $query .= "&labelType=" . get_option("wc_pont_posta_labeltype", "A5"); goto qz0l4; PZrzg: $body = json_encode($parcels); goto aEHe0; f3Egz: WC_Pont::log("Export: get labels" . " order id: " . implode(", ", $trs) . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "error"); goto lrmvF; DXsdG: if (!(200 != check_response($resp, $order_id))) { goto m1KqE; } goto IWl1N; w9Sj4: GWm_q: goto DfyFV; O1GOj: if (!$trs) { goto xIU4Y; } goto olqSD; hSI2S: bwzfn: goto WU6ri; cJx6C: return get_transient("pont_pcls") && count(get_transient("pont_pcls")); goto cr0U4; qz0l4: $url = "https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/label?" . $query; goto YLnIK; ilyZS: WC_Pont::update_order_status($PrintLabelsInfoList->PrintLabelsInfo->ClientReference); goto w9Sj4; DfyFV: if (!("yes" === get_option("wc_pont_posta_close"))) { goto jxh9g; } goto cJx6C; cr0U4: jxh9g: goto q2b13; ZDagh: return; goto Cagki; Z5jFu: $exp = 0; goto cBay1; DApIi: $csomag->init(); goto IkQ3d; qnUcJ: if (!(200 != check_response($resp, $order_id))) { goto AgEL2; } goto f3Egz; Cagki: YtfHO: goto iESFq; TFNTH: $params = array("timeout" => apply_filters("wc_pont_export_posta_timeout", 10), "httpversion" => "1.1", "body" => $body, "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto AepFN; CSfde: foreach ($resp as $r) { goto g42mU; tbOWb: WC_Pont::st_array("pont_pcls", $parcels[$i]->orderId, $r->trackingNumber); goto MDEtM; Vsvov: BzEyc: goto N0Hl7; g42mU: if (!isset($r->errors)) { goto XlWWB; } goto IIY7V; uBxE7: goto BzEyc; goto D2v6I; IIY7V: WC_Pont::st_array("pont_errors", $parcels[$i]->orderId, sprintf("%s. MPL \xc3\241ltal k\xc3\xbcld\xc3\266tt hibak\303\xb3d: %s. Hibale\xc3\xadr\303\241s: %s", __("C\303\255mkenyomtatat\303\xa1si probl\xc3\251ma", "wc-pont"), implode(", ", array_column($r->errors, "code")), implode(", ", array_column($r->errors, "text")))); goto Nbp9m; kWV0l: $i++; goto Vsvov; Nbp9m: $i++; goto uBxE7; MDEtM: $trs[$parcels[$i]->orderId] = $r->trackingNumber; goto kWV0l; D2v6I: XlWWB: goto tbOWb; N0Hl7: } goto ZdBA7; olqSD: $params = array("timeout" => 10, "httpversion" => "1.1", "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto O8hHJ; dzHma: $i = 0; goto ChaIy; hgXoL: } goto SIfem; SIfem: function posta_shipments_close($params_body = "{}") { goto onp_M; sk3ZP: $csomag->init(); goto MyUNw; gBzZS: return; goto XIBRo; XIBRo: mtc9G: goto g4Vg2; LTn4U: $resp = wp_remote_post("https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/close", http_build_query($params)); goto Ofug8; urV_P: $csomag = new posta(); goto sk3ZP; HibW6: $filename = date("Ymd-His") . "-sz\303\241ll\303\xadt\xc3\xb3lev\xc3\xa9l.pdf"; goto PIFt6; Ofug8: if (!(200 != check_response($resp, 0))) { goto mtc9G; } goto UT0IK; g4Vg2: $resp = json_decode(wp_remote_retrieve_body($resp)); goto HibW6; MyUNw: $csomag->get_access(); goto seIP3; g6G5w: $pont_pdf2[] = $filename; goto mJ7G1; PIFt6: file_put_contents(trailingslashit(WC_Pont::wc_pont_upload_dir()) . $filename, base64_decode($resp[0]->manifest)); goto g6G5w; UT0IK: WC_Pont::st_array("pont_errors", "Posta", __("Hiba a jegyz\xc3\251k z\303\241r\303\xa1sa sor\303\xa1n", "wc-pont") . ": " . json_encode($resp->errors)); goto gBzZS; onp_M: WC_Pont::log("Posta close shipments", "info"); goto urV_P; seIP3: $params = array("timeout" => 20, "httpversion" => "1.1", "body" => $params_body, "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto LTn4U; mJ7G1: set_transient("pont_pdf2", $pont_pdf2, 5 * MINUTE_IN_SECONDS); goto f7YLK; f7YLK: } goto gLEY7; c1Yzg: if (is_admin()) { goto gAT8G; } goto sJCzu; gLEY7: function get_posta_tracking_info($pn, $order_id) { goto CUCcO; x2xHX: $tracking = (object) ["date" => "Friss\xc3\255tve: " . date("Y-m-d H:i", current_time("timestamp")), "code" => 0, "category" => '', "event" => __("Nincs adat", "wc-pont"), "location" => '']; goto tP4ps; KNK7z: return tracking_data_html($pn, $tracking, "Posta"); goto GpYpB; s1xGf: WC_Pont::log("Posta sent tracking query: " . json_encode($query, JSON_UNESCAPED_UNICODE), "info"); goto Bd5Dr; qHMns: if (!$tracking) { goto yWd0Y; } goto fgqnD; WCBEv: if (!(200 != $respcode)) { goto JFrGB; } goto NQabW; jVB35: $tracking = (object) ["date" => date("Y-m-d H:i", strtotime($status[0]->c11 . " " . $status[0]->c12)), "code" => array_search($status[0]->c9, WC_Pont::$postaTrCodes), "category" => $status[0]->c43, "event" => $status[0]->c9, "location" => $status[0]->c13 ? $status[0]->c13 : '']; goto rH7fm; I82cf: WC_Pont::log("Posta tracking response" . " tr: " . $pn . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "info"); goto CUDwX; Vz_PN: $body = ["language" => "hu", "ids" => $pn, "state" => "last"]; goto FhtM3; pc9jV: $respcode = wp_remote_retrieve_response_code($resp); goto WCBEv; u2UER: hIiDz: goto jVB35; FhtM3: $params = array("timeout" => 10, "httpversion" => "1.1", "body" => json_encode($body), "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto ICPQO; CUCcO: $tracking = get_transient("pont_tacking_" . $pn); goto qHMns; Kyh2w: $resp = json_decode(wp_remote_retrieve_body($resp)); goto I82cf; SlOs_: if (!empty($status)) { goto hIiDz; } goto x2xHX; orpn_: $time = date("H:i:s", $timeout - time()); goto kQHuS; d5iY7: return tracking_data_html($pn, $tracking, "Posta"); goto u2UER; DzI3b: $csomag->init(); goto aI29t; ICPQO: $query = http_build_query($params); goto s1xGf; aI29t: $csomag->get_access(); goto Vz_PN; aOu66: yWd0Y: goto VsQkq; VsQkq: $csomag = new posta(); goto DzI3b; SMWYG: return array(sprintf("<a class="posta error" target="_blank" title="%s" href="%s" >%s</a>", __("Kapcsol\303\263d\303\xa1si hiba", "wc-pont"), "https://www.posta.hu/nyomkovetes/nyitooldal?searchvalue=" . $pn, __("Nincs adat", "wc-pont"), __("Nincs adat", "wc-pont")), 0); goto k3rLa; tP4ps: set_transient("pont_tacking_" . $pn, $tracking, 15 * MINUTE_IN_SECONDS); goto d5iY7; EFhA8: return tracking_data_html($pn, $tracking, "Tran"); goto aOu66; fgqnD: $timeout = get_option("_transient_timeout_" . "pont_tacking_" . $pn); goto orpn_; rH7fm: set_transient("pont_tacking_" . $pn, $tracking, 1 * HOUR_IN_SECONDS); goto LOKZa; kQHuS: WC_Pont::log("Posta tracking data by transient. Tracking number: " . $pn . "Order id: " . $order_id . " time: " . $time, "info"); goto EFhA8; CUDwX: $status = $resp->trackAndTrace; goto SlOs_; k3rLa: JFrGB: goto Kyh2w; NQabW: WC_Pont::log("Posta tracking response: " . wc_print_r($resp, true), "error"); goto SMWYG; LOKZa: update_post_meta($order_id, "_tracking_data", $tracking); goto KNK7z; Bd5Dr: $resp = wp_remote_post("https://" . $csomag->env . ".api.posta.hu/v2/nyomkovetes/registered", $query); goto pc9jV; GpYpB: } goto Qugjz; m4XUA: function get_contents($order) { goto hZAPP; mfehv: nMZ9c: goto hxVVR; hxVVR: return $contents; goto pQZXM; mWxiC: foreach ($order->get_items() as $key => $item) { goto B74Yf; algF6: $contents[$key]["qty"] = $item["qty"]; goto qvuQm; jec3a: $contents[$key]["name"] = $product->get_name(); goto psFeF; qvuQm: XQAqD: goto YF979; psFeF: $contents[$key]["sku"] = $product->get_sku(); goto algF6; B74Yf: $product = $item["variation_id"] ? new WC_Product_Variation($item["variation_id"]) : ($product = new WC_Product($item["product_id"])); goto jec3a; YF979: } goto mfehv; hZAPP: $contents = array(); goto mWxiC; pQZXM: } goto MXLO2; sJCzu: return; goto Y6VRx; Y6VRx: gAT8G: goto bCG2m; Qugjz: function tracking_data_html($pn, $tracking, $info) { return array(sprintf("<a class="posta s%s" target="_blank" title="%s" href="%s" data-info="%s">%s</a>", $tracking->category, $tracking->date . " " . $tracking->location, sprintf(WC_Pont::$trk_urls["posta"], $pn), $info, $tracking->event), $tracking->code); } goto qI5y2; bCG2m: class shipments_table extends WP_List_Table { public $parcels = array(); public $pagination = 50; public function prepare_items() { goto hHt81; apQ2F: $this->items = $data; goto gDlt8; fvqmd: $data = array_slice($this->parcels, ($currentPage - 1) * $this->pagination, $this->pagination); goto ovBA9; ovBA9: $this->_column_headers = array($columns, $hidden, $sortable); goto apQ2F; yaabV: $sortable = $this->get_sortable_columns(); goto RBENO; znJbB: $hidden = $this->get_hidden_columns(); goto yaabV; hHt81: $columns = $this->get_columns(); goto znJbB; j8eNO: $this->set_pagination_args(array("total_items" => count($this->parcels), "per_page" => $this->pagination)); goto eB_5u; eB_5u: $currentPage = $this->get_pagenum(); goto fvqmd; RBENO: usort($this->parcels, array(&$this, "sort_data")); goto j8eNO; gDlt8: } public function get_columns() { $columns = array("pn" => __("Ragsz\xc3\xa1m", "wc-pont"), "date" => __("D\303\xa1tum", "wc-pont"), "order_id" => __("Rendel\xc3\251s sz\303\xa1ma", "wc-pont"), "recipient_name" => __("C\303\xadmzett", "wc-pont"), "recipient_contact" => __("El\303\251rhet\305\x91s\303\xa9g", "wc-pont"), "recipient_address" => __("C\xc3\xadm", "wc-pont"), "items" => __("Csomagok", "wc-pont")); return $columns; } public function get_hidden_columns() { return array(); } public function get_sortable_columns() { return array("title" => array("title", false)); } public function column_default($item, $column_name) { goto GxuxI; GxuxI: switch ($column_name) { case "pn": case "date": case "order_id": case "recipient_name": case "recipient_contact": case "recipient_address": case "items": return $item[$column_name]; default: return print_r($item, true); } goto HzKNi; ZYPOa: cyDsz: goto v_9Oo; HzKNi: r4oUm: goto ZYPOa; v_9Oo: } private function sort_data($a, $b) { goto zsQSG; SkiH_: AuW8V: goto k6j7I; k6j7I: $result = strcmp($a[$orderby], $b[$orderby]); goto cvTcf; GpdgV: MEtiL: goto fjzzA; kttKv: $orderby = $_GET["orderby"]; goto y9Oy7; cvTcf: if (!($order === "asc")) { goto MEtiL; } goto cceEt; y9Oy7: ppGgE: goto OFpwu; fjzzA: return -$result; goto Y4Sgb; OFpwu: if (empty($_GET["order"])) { goto AuW8V; } goto t8FvD; cceEt: return $result; goto GpdgV; GkEka: if (empty($_GET["orderby"])) { goto ppGgE; } goto kttKv; zsQSG: $orderby = "date"; goto A6waY; A6waY: $order = "desc"; goto GkEka; t8FvD: $order = $_GET["order"]; goto SkiH_; Y4Sgb: } } ?>
Did this file decode correctly?
Original Code
<?php
/*
* @version $Id: Pont V7.6 2021-10-23 szathmari.hu $
* @copyright Copyright (C) 2021 szathmari.hu - All rights reserved.
* @license commerical
* @url https://szathmari.hu
*/
goto UtwY_; UtwY_: class posta { public $acc; public $key; public $secret; public $access_token; public $test; public $parcel; function init() { goto tO0Pc; D1Mz5: WDkQ6: goto ytaMV; ABHQq: $this->acc = get_option("wc_pont_posta_acc"); goto D1Mz5; XN6JX: $this->env = get_option("wc_pont_posta_test") === "yes" ? "sandbox" : "core"; goto WEeUo; G76Nv: $this->secret = get_option("wc_pont_posta_secret"); goto XN6JX; ytaMV: $this->key = get_option("wc_pont_posta_key"); goto G76Nv; tO0Pc: if (empty(get_option("wc_pont_posta_acc"))) { goto WDkQ6; } goto ABHQq; WEeUo: } function get_access() { goto Ny2jN; NU0sf: cgRTn: goto btdst; LU7Cr: WC_Pont::log("Export:\x9Posta hiba" . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "error"); goto z3JuN; z3JuN: WC_Pont::st_array("pont_errors", "Posta", __("Kapcsol\xc3\263d\303\241si probl\xc3\251ma", "wc-pont") . ": " . json_encode($resp->errors)); goto OTb8q; wm_mS: return; goto jd36s; ceIYN: $this->access_token = $token; goto gpxN8; ANpLZ: WC_Pont::log("Export: Posta hiteles\xc3\xadt\303\251s sikertelen" . " response: " . $resp["body"], "error"); goto KVhmF; cOx4l: $params = array("timeout" => 10, "httpversion" => "1.1", "body" => ["grant_type" => "client_credentials"], "Accept" => "application/json", "Content-Type" => "application/json", "headers" => ["Authorization" => "Basic " . base64_encode($this->key . ":" . $this->secret)]); goto qhp47; Ny2jN: $token = get_transient("pont_posta_token"); goto ErBYg; gpxN8: WC_Pont::log("Posta\x9Access by stored token", "info"); goto wm_mS; qhp47: $resp = wp_remote_post("https://" . $this->env . ".api.posta.hu/oauth2/token", http_build_query($params)); goto aW783; btdst: $resp = json_decode(wp_remote_retrieve_body($resp)); goto l4xuh; pl3Mg: WC_Pont::log("Export: oauth2" . " resp code: " . $respcode . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "info"); goto iGkRV; CW5y8: if (400 <= $respcode) { goto CMoNr; } goto pl3Mg; M3J_8: set_transient("pont_posta_token", $resp->access_token, 15 * MINUTE_IN_SECONDS); goto F0lB_; l4xuh: $this->access_token = $resp->access_token; goto M3J_8; aW783: if (!is_wp_error($resp)) { goto v9mN8; } goto LU7Cr; ErBYg: if (!$token) { goto XhH0P; } goto ceIYN; jd36s: XhH0P: goto cOx4l; psiID: $respcode = wp_remote_retrieve_response_code($resp); goto CW5y8; KVhmF: WC_Pont::st_array("pont_errors", "Posta", __("Hiteles\xc3\xadt\xc3\251si probl\xc3\xa9ma", "wc-pont")); goto o0thE; zRzpy: v9mN8: goto psiID; Cmz0d: CMoNr: goto ANpLZ; o0thE: return; goto NU0sf; OTb8q: return false; goto zRzpy; iGkRV: goto cgRTn; goto Cmz0d; F0lB_: } function setDOP($order, $order_id, $pont) { goto c0p0I; WHjOe: fpbih: goto N5xHL; AJxHM: nWNUj: goto BnfUw; eKZtK: $this->parcel->recipient->address->parcelPickupSite = $p[$id]["name"]; goto Khex6; BnfUw: if (!empty($p)) { goto cRjH0; } goto Vo9KQ; Fk6rf: b9c3w: goto PLHkT; Khex6: return true; goto WHjOe; uV1hD: $pp[] = json_decode(@file_get_contents(WC_Pont::$plugin_path . "postacspont.json"), true); goto DuQ1q; Vo9KQ: return false; goto HyEkS; D30k5: $this->parcel->item[0]->services->deliveryMode = $p[$id]["group"]; goto eKZtK; PLHkT: if (!is_array($p[$id])) { goto fpbih; } goto D30k5; HyEkS: cRjH0: goto MGKkY; MGKkY: $id = array_search($pont[2], array_column($p, "id")); goto wIJjQ; GOq7N: $pp[] = json_decode(@file_get_contents(WC_Pont::$plugin_path . "postappont.json"), true); goto uV1hD; wIJjQ: if (!($id === false)) { goto b9c3w; } goto vkJ_F; c0p0I: $pp[] = json_decode(@file_get_contents(WC_Pont::$plugin_path . "postampont.json"), true); goto GOq7N; DuQ1q: $p = []; goto IQk_u; IQk_u: foreach ($pp as $t) { goto DTz0E; SpAU3: $p = array_merge($p, $t); goto F312v; e7KQo: Cktud: goto edack; DTz0E: if (!is_array($t)) { goto HnX0w; } goto SpAU3; F312v: HnX0w: goto e7KQo; edack: } goto AJxHM; vkJ_F: return false; goto Fk6rf; N5xHL: } } goto ZERF_; E9yqE: function delete_posta_package($pns) { goto BypVd; BypVd: WC_Pont::log("Posta\x9delete shipments", "info"); goto sUKoR; NaVgJ: $csomag->init(); goto xFL7G; DiTCe: xJioC: goto x3lNV; A7Nyu: $t = []; goto xTdub; x3lNV: return $t; goto f4kka; xTdub: foreach ($pns as $pn) { goto Rcmvx; pxZUZ: $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); goto tmUFp; T0enV: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); goto K2rsS; Httj9: WC_Pont::log("Posta delete: " . json_encode($result, JSON_UNESCAPED_UNICODE), "error"); goto Hurrv; IVI5H: curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); goto qA8Pz; AD30V: $t[$pn] = __("T\303\266r\303\266lve", "wc-pont"); goto Ny7ha; Hurrv: TDRC4: goto t5vvm; lRC1D: curl_close($ch); goto ZGl_p; PWJyY: curl_setopt($ch, CURLOPT_HEADER, TRUE); goto IVI5H; Xttkx: curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE); goto PWJyY; Rcmvx: $url = "https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/" . $pn; goto lFz3k; hoVG7: $t[$pn] = __("Hibak\xc3\xb3d", "wc-pont") . ": " . implode(", ", $e); goto Httj9; tmUFp: $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE)); goto xqh_Q; K2rsS: curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); goto Xttkx; jPXTF: $headers = ["Accept: application/json", "Content-Type: application/json; charset=utf-8", "X-Request-Id: " . get_uuid(), "X-Accounting-Code: " . $csomag->acc, "Authorization: Bearer " . $csomag->access_token]; goto Fv0n5; yClSn: goto Kgj7d; goto pEzwy; Fv0n5: $ch = curl_init(); goto lOj50; N8vVx: $t[$pn] = __("Hiba", "wc-pont") . ": " . $httpcode; goto yClSn; t5vvm: Kgj7d: goto PJM83; PJM83: gRgZT: goto a52gy; oFTBX: if (isset($result->errors)) { goto xLcgg; } goto AD30V; JC9uc: if (200 == $httpcode) { goto RWBH5; } goto N8vVx; qA8Pz: $response = curl_exec($ch); goto pxZUZ; xqh_Q: $result = json_decode($body); goto lRC1D; HKZPH: $e = array_column($result->errors, "code"); goto hoVG7; pEzwy: RWBH5: goto oFTBX; lFz3k: $params = array("timeout" => 10, "httpversion" => "1.1", "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto jPXTF; z6RRR: xLcgg: goto HKZPH; ZGl_p: WC_Pont::log("Posta\x9delete: " . " TR: " . $pn . " result: " . wc_print_r($response, true) . " body: " . $body, "info"); goto JC9uc; lqJgH: curl_setopt($ch, CURLOPT_URL, $url); goto S3aep; S3aep: curl_setopt($ch, CURLOPT_TIMEOUT, 10); goto T0enV; Ny7ha: goto TDRC4; goto z6RRR; lOj50: curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); goto lqJgH; a52gy: } goto DiTCe; xFL7G: $csomag->get_access(); goto A7Nyu; sUKoR: $csomag = new posta(); goto NaVgJ; f4kka: } goto c1Yzg; Ft8km: function check_response($resp, $order_id) { goto TjXo_; oJjpQ: return $respcode; goto rBuQe; ZADDX: WC_Pont::log("Posta response: " . json_encode(array($resp), JSON_UNESCAPED_UNICODE), "error"); goto dSphf; dSphf: WC_Pont::st_array("pont_errors", $order_id, sprintf("%s: %s, hibale\303\255r\xc3\241s: %s", __("Hiba t\xc3\266rt\303\251nt. MPL \xc3\241ltal k\303\274ld\xc3\266tt hibak\xc3\xb3d", "wc-pont"), $respcode, wp_remote_retrieve_response_message($resp))); goto JYJ3U; TjXo_: $respcode = wp_remote_retrieve_response_code($resp); goto agYfa; agYfa: if (!(200 != $respcode)) { goto cwdu5; } goto ZADDX; JYJ3U: cwdu5: goto oJjpQ; rBuQe: } goto BND_5; qI5y2: function get_uuid() { goto qxUYH; v5Y9N: return vsprintf("%s%s-%s-%s-%s-%s%s%s", str_split(bin2hex($data), 4)); goto mdtZ_; QFrUo: $data[6] = chr(ord($data[6]) & 0xf | 0x40); goto phZid; qxUYH: $data = random_bytes(16); goto QFrUo; phZid: $data[8] = chr(ord($data[8]) & 0x3f | 0x80); goto v5Y9N; mdtZ_: } goto Ft8km; BND_5: function remark_on_label($order, $template, $length = null) { goto Hq1Km; wbcgl: if (!(sizeof($iTemplate) > 0)) { goto PvfcU; } goto LZE6Y; Fjlry: PvfcU: goto lVMjC; QI2A7: return mb_substr($template, 0, $length ?? 40); goto Nf1SY; p0aIr: $order_id = $order->get_order_number(); goto nL0wl; Ut0aX: $iTemplate = array(); goto SqOdL; lVMjC: $template .= " " . implode("|", $itemTemplate); goto QI2A7; fox8I: ECRFq: goto wQRHP; aLPmz: foreach ($lItems as $k => $lItem) { goto QyKC0; IWM0C: $iTemplate[] = " " . $k . $lItem; goto s1CLQ; dTv1T: $template = str_replace($lItem, " ", $template); goto IWM0C; s1CLQ: mAtgn: goto s_W10; s_W10: Eg0g8: goto evgmc; QyKC0: if (!(strpos($template, $lItem) !== false)) { goto mAtgn; } goto dTv1T; evgmc: } goto fox8I; nL0wl: $templateRep = array("[megjegyz\xc3\xa9s]" => $customer_message, "[\303\xbajsor]" => "\xa", "[rendel\303\251ssz\xc3\xa1m]" => $order_id); goto zOQJ_; wQRHP: $contents = get_contents($order); goto wbcgl; cavar: $lItems = array("#" => "[cikksz\xc3\xa1m]", '' => "[term\303\xa9k]", "db: " => "[mennyis\303\251g]"); goto Ut0aX; LZE6Y: foreach ($contents as $content) { $itemTemplate[] = strtr(implode(" ", $iTemplate), array("[term\xc3\xa9k]" => $content["name"], "[cikksz\303\241m]" => $content["sku"], "[mennyis\303\251g]" => $content["qty"])); JSlfM: } goto XY9vp; XY9vp: MmY8S: goto Fjlry; Hq1Km: $customer_message = !empty($order->get_customer_note()) ? $order->get_customer_note() : ''; goto cavar; zOQJ_: $template = strtr($template, $templateRep); goto aLPmz; SqOdL: $itemTemplate = array(); goto p0aIr; Nf1SY: } goto m4XUA; MXLO2: function get_posta_shipments($pn = null) { goto mhui1; RIQvr: foreach ($resp as $r) { goto PrQEe; PrQEe: $packages = null; goto p1I1B; FbeLF: $address = $r->shipment->recipient->address; goto IWV0x; AFZId: RcJg3: goto jpXbF; VaE5x: j69JM: goto FbeLF; F2r4N: $table->parcels[] = array("pn" => sprintf("%s <a href="%s" class="your-class">%s</a>", $r->shipment->trackingNumber, $delete_url, __("T\xc3\xb6r\xc3\266l", "wc-pont")), "date" => date("Y-m-d H:i", strtotime($r->shipment->shipmentDate)), "order_id" => $r->shipment->orderId, "recipient_name" => $r->shipment->recipient->contact->name, "recipient_contact" => $r->shipment->recipient->contact->email . " " . $r->shipment->recipient->contact->phone, "recipient_address" => sprintf("%s %s, %s", $address->postCode, $address->city, $address->address), "items" => $packages); goto AFZId; p1I1B: foreach ($r->shipment->item as $i) { goto LcwZE; JfLnX: $packages = sprintf("m\xc3\251ret: <b>%s</b> egy\xc3\xa9ni 1: <b>%s</b> egy\xc3\251ni 2: <b>%s</b> ut\xc3\241nv\303\251t: <b>%s</b> szolg\303\xa1ltat\xc3\xa1s: <b>%s</b> extra: <b>%s</b> k\xc3\xa9zbes\xc3\xadt\303\xa9s: <b>%s</b> d\303\255j: <b>%s</b> ut\303\241nv\xc3\xa9t: <b>%s</b>", $i->size, $i->customData1 ?? '', $i->customData2 ?? '', $i->services->cod, $i->services->basic, $extra, $i->services->deliveryMode ?? '', $i->fee ?? "-", $i->services->cod ?? "-"); goto CDCZV; LcwZE: $extra = implode(", ", $i->services->extra); goto JfLnX; CDCZV: CHuRm: goto wIRn3; wIRn3: } goto VaE5x; IWV0x: $delete_url = wp_nonce_url(add_query_arg(array("pn" => array($r->shipment->trackingNumber)), admin_url("admin.php?page=posta")), "postapage", "_wpnonce"); goto F2r4N; jpXbF: } goto e5Tmv; h7KG3: $respcode = wp_remote_retrieve_response_code($resp); goto iyUer; Y6zHq: $csomag->init(); goto mroYI; GBx4p: NuEuh: goto MlLFp; ZgD3D: $csomag = new posta(); goto Y6zHq; HUTry: $limit = filter_input(INPUT_GET, "limit", FILTER_VALIDATE_INT); goto xJk9T; PTrq0: $resp = wp_remote_get($url, $params); goto h7KG3; LjQr0: return count($resp); goto DXVqr; xJk9T: if (!$limit) { goto ryE_F; } goto Zskeb; PcqQH: return null; goto GBx4p; MSIWk: ryE_F: goto obCma; Zskeb: $table->pagination = $limit; goto MSIWk; iyUer: if (!(200 != $respcode)) { goto NuEuh; } goto EitcT; e5Tmv: pOZ57: goto HUTry; EitcT: WC_Pont::log("Posta\x9response: " . json_encode(array($resp), JSON_UNESCAPED_UNICODE), "error"); goto PcqQH; MlLFp: $resp = json_decode(wp_remote_retrieve_body($resp)); goto w3xq1; obCma: $table->prepare_items(); goto afpuM; mhui1: WC_Pont::log("Posta\x9get shipments", "info"); goto ZgD3D; mroYI: $csomag->get_access(); goto xlDX6; afpuM: $table->display(); goto LjQr0; pfrYM: $params = array("timeout" => 20, "httpversion" => "1.1", "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto PTrq0; xlDX6: $url = "https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/"; goto pfrYM; w3xq1: $table = new shipments_table(); goto RIQvr; DXVqr: } goto E9yqE; ZERF_: function export_posta($order_ids) { goto uxCII; ChaIy: $trs = []; goto CSfde; H7bIi: $resp = wp_remote_post("https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments", $query); goto o5DpY; uxCII: $csomag = new posta(); goto DApIi; hh1d3: WC_Pont::st_array("pont_errors", $order_id, __("C\303\xadmkenyomtatat\303\xa1si probl\xc3\xa9ma", "wc-pont") . ": " . json_encode($resp)); goto F81bS; g5YnL: xIU4Y: goto PifFg; IWl1N: return; goto kPNts; b_jup: WC_Pont::st_array("pont_errors", 0, __("C\xc3\255mkelekelet\xc3\266lt\xc3\251si probl\xc3\xa9ma:", "wc-pont") . ": " . json_encode($resp)); goto ZDagh; HF9o9: foreach ($trs as $o_id => $tr) { WC_Pont::st_array("pont_pdf", $o_id, $filename); xovJX: } goto F2pUq; sKlgk: if (!is_wp_error($resp)) { goto YtfHO; } goto b_jup; O8hHJ: $query = "trackingNumbers=" . implode("&trackingNumbers=", $trs); goto tqxYP; LEeoz: file_put_contents(trailingslashit(WC_Pont::wc_pont_upload_dir()) . $filename, base64_decode($resp[0]->label)); goto HF9o9; F81bS: return; goto hSI2S; SmIji: WC_Pont::log("Export:\x9Parcel print" . " order id: " . implode(", ", $exported_ids) . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "error"); goto hh1d3; Lfyl4: b_I1x: goto HdK0p; IkQ3d: $csomag->get_access(); goto Z5jFu; ZdBA7: H05In: goto O1GOj; tbBRp: WC_Pont::log("Export:\x9Parcel print" . " order id: " . implode(", ", $exported_ids) . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "info"); goto dzHma; kxLsw: foreach ($order_ids as $order_id) { goto wgKNi; Vwwby: $csomag->parcel->item[0] = $item; goto v1GuT; T9eY7: goto ulTla; goto D9knW; SuwdT: if (!$pont) { goto A2Ewc; } goto je5Jm; FqIqh: $csomag->parcel->recipient = $recipient; goto ntfaR; zQMqW: $value = !empty($max_value) && is_numeric($max_value) && $order->get_total() > $max_value ? $max_value : $order->get_total(); goto MEoE4; gorAC: $custom_data1 = remark_on_label($order, $template); goto P2AWt; b622v: WC_Pont::st_array("pont_errors", $order->get_order_number(), sprintf(__("A rendel\303\xa9s nem lett export\303\241lva, %s meta alapj\xc3\241n kiz\303\241rva", "wc-pont"), $exclude)); goto AE1v8; Lkb5O: if (!("cod" === $order->get_payment_method())) { goto ZIPvi; } goto PaU19; oNo4A: $item->services->extra[] = "K_UVT"; goto nnLj9; XSS1r: $template = get_option("wc_pont_posta_remark_template"); goto agGhK; T5LjC: PME7p: goto mkIsl; Wg_8x: if (empty($template)) { goto cV48v; } goto gorAC; je5Jm: $p = explode("|", $pont); goto p2656; N8xFo: goto ulTla; goto mZbhY; NpPay: $custom_data2 = ''; goto U8Ra1; AnXW8: if (!($exclude && get_post_meta($order_id, $exclude))) { goto yZnrb; } goto b622v; EQXEm: if (!(strpos($sMethod["method_id"], "local_pickup") !== false)) { goto ydWtq; } goto r8bCa; mYG3M: WC_Pont::log("Export:\x9Parcel done" . " order id: " . $order_id . " parcel: " . wc_print_r($csomag->parcel, true), "info"); goto wR98L; mkIsl: $exclude = get_option("wc_pont_posta_exclude"); goto AnXW8; JXaNc: VCbJr: goto JlXl5; vJmIW: if (empty($template)) { goto z2oka; } goto Z7qby; acUqu: A2Ewc: goto JL21g; JlXl5: $max_value = get_option("wc_pont_posta_max_value"); goto zQMqW; l904b: EKjow: goto acUqu; ntfaR: $template = get_option("wc_pont_posta_custom_data1_template"); goto EhanR; T0CJa: $recipient = (object) ["contact" => (object) ["name" => trim($order->get_shipping_company() . " " . $order->get_shipping_last_name() . " " . $order->get_shipping_first_name()), "email" => $order->get_billing_email(), "phone" => get_option("wc_pont_posta_format_phone") === "yes" ? substr(formatPhone($order->get_billing_phone()), 0, 13) : $order->get_billing_phone()], "address" => (object) ["postCode" => $order->get_shipping_postcode(), "city" => $order->get_shipping_city(), "address" => @$order->get_shipping_address_2() ? $order->get_shipping_address_1() . " " . $order->get_shipping_address_2() : $order->get_shipping_address_1(), "parcelPickupSite" => '', "remark" => $remark]]; goto FqIqh; PaU19: $item->services->cod = (float) $order->get_total(); goto oNo4A; S5nOy: $item->size = empty(get_post_meta($order_id, "package_size")) ? get_option("wc_pont_posta_size", "M") : get_post_meta($order_id, "package_size", true); goto M92c2; ml4dP: if (!(false === $dop)) { goto LHoV9; } goto Zl57Z; GjX5H: if (!($services && is_array($services))) { goto PME7p; } goto rN5Dq; sYCpg: $custom_data2 = remark_on_label($order, $template); goto JXaNc; sn741: $exp++; goto GMbrb; ekQrL: $order = new WC_Order($order_id); goto W9KKz; D9knW: LHoV9: goto l904b; GMbrb: ulTla: goto VKGrE; P2AWt: cV48v: goto TqlBi; Zl57Z: WC_Pont::st_array("pont_errors", $order->get_order_number(), __("\303\x81tvev\xc5\221pont nem tal\xc3\241lhat\303\263:", "wc-pont") . " " . $p[2]); goto T9eY7; W9KKz: $sMethod = $order->get_shipping_methods(); goto dTJx2; r8bCa: WC_Pont::st_array("pont_errors", $order->get_order_number(), __("Rendel\xc3\251s nem ker\xc3\xbclt tov\303\241bb\xc3\xadt\303\xa1sra, szem\303\251lyes \303\241tv\xc3\xa9tellel k\303\251rte", "wc-pont")); goto N8xFo; v1GuT: $pont = get_post_meta($order_id, "wc_selected_pont", true); goto SuwdT; sVsF0: goto ulTla; goto p2yzF; wsMgl: WC_Pont::st_array("pont_errors", $order->get_order_number(), sprintf(__("A rendel\303\xa9st %s sz\303\241ll\303\xadt\303\241ssal k\xc3\251rte", "wc-pont"), $p[1])); goto sVsF0; MEoE4: $item = (object) ["customData1" => $custom_data1, "customData2" => $custom_data2, "weight" => ["value" => WC_Pont::get_package_weight($order), "unit" => "g"], "size" => "M", "services" => (object) ["basic" => "A_175_UZL", "extra" => [], "cod" => 0, "value" => (float) $value, "deliveryMode" => "HA"]]; goto S5nOy; rN5Dq: $item->services->extra = array_merge($item->services->extra, $services); goto T5LjC; wgKNi: $csomag->parcel = (object) ["sender" => ["agreement" => get_option("wc_pont_posta_agreement"), "accountNo" => (string) get_option("wc_pont_posta_account_no"), "contact" => ["name" => get_option("wc_pont_posta_sender_name"), "email" => get_option("wc_pont_posta_sender_mail"), "phone" => get_option("wc_pont_posta_sender_phone")], "address" => ["postCode" => get_option("wc_pont_posta_sender_zip"), "city" => get_option("wc_pont_posta_sender_city"), "address" => get_option("wc_pont_posta_sender_address"), "remark" => '']], "recipient" => (object) ["contact" => (object) ["name" => '', "email" => '', "phone" => ''], "address" => (object) ["postCode" => '', "city" => '', "address" => '', "parcelPickupSite" => '', "remark" => ''], "disabled" => false], "orderId" => (string) $order_id, "developer" => "szathmari.hu", "webshopId" => get_option("wc_pont_posta_sender_name"), "labelType" => get_option("wc_pont_posta_labeltype", "A5"), "tag" => '', "paymentMode" => get_option("wc_pont_posta_payment_mode", "UV_AT"), "packageRetention" => (int) get_option("wc_pont_posta_retention", "5"), "item" => []]; goto ekQrL; M92c2: $services = get_option("wc_pont_posta_service_extra"); goto GjX5H; U8Ra1: if (empty($template)) { goto VCbJr; } goto sYCpg; icaio: $dop = $csomag->setDOP($order, $order_id, $p); goto ml4dP; w_P5g: z2oka: goto T0CJa; dTJx2: $sMethod = reset($sMethod); goto EQXEm; wR98L: $parcels[] = $csomag->parcel; goto sn741; p2656: if (strpos($p[1], "Posta") !== false) { goto zq_3M; } goto wsMgl; nnLj9: ZIPvi: goto Vwwby; EhanR: $custom_data1 = ''; goto Wg_8x; p2yzF: goto EKjow; goto JneiR; Z7qby: $remark = remark_on_label($order, $template, 50); goto w_P5g; mZbhY: ydWtq: goto XSS1r; JL21g: do_action("woocommerce_" . "wc_pont" . "_export_posta_data", $csomag->parcel, $order); goto mYG3M; h3Ong: yZnrb: goto Lkb5O; JneiR: zq_3M: goto icaio; TqlBi: $template = get_option("wc_pont_posta_custom_data2_template"); goto NpPay; AE1v8: goto ulTla; goto h3Ong; agGhK: $remark = ''; goto vJmIW; VKGrE: } goto Lfyl4; AepFN: $query = http_build_query($params); goto H7bIi; aEHe0: WC_Pont::log("Posta data" . " X-Accounting-Code: " . $csomag->acc . " send: " . json_encode($parcels, JSON_UNESCAPED_UNICODE), "info"); goto TFNTH; ZMXei: $resp = wp_remote_get($url, $params); goto qnUcJ; WU6ri: $resp = json_decode(wp_remote_retrieve_body($resp)); goto tbBRp; TelN0: if (!(get_option("wc_pont_export_mod_status") == "yes")) { goto GWm_q; } goto ilyZS; X7WDg: posta_shipments_close(); goto zzRl9; iESFq: $resp = json_decode(wp_remote_retrieve_body($resp)); goto hBbUL; PifFg: set_transient("pont_carrier", "posta", 5 * MINUTE_IN_SECONDS); goto TelN0; Kq9JB: if (!is_wp_error($resp)) { goto bwzfn; } goto SmIji; HdK0p: $exported_ids = array_column($parcels, "orderId"); goto PZrzg; kPNts: m1KqE: goto Kq9JB; zzRl9: return count(get_transient("pont_pcls")); goto hgXoL; hBbUL: $filename = date("Ymd-His") . ".pdf"; goto LEeoz; lrmvF: AgEL2: goto sKlgk; F2pUq: TLMdQ: goto g5YnL; q2b13: $body = "\xa{
"fromDate": "2020-07-23T12:31:05.851Z",
"toDate": "2020-07-23T12:31:05.851Z",
"trackingNumbers": [
"PNVF195161001"\xa],
"checkList": true,\xa"tag": "string"
}\xa"; goto X7WDg; cBay1: $parcels = []; goto kxLsw; o5DpY: WC_Pont::log("Posta\x9sent query: " . json_encode($query, JSON_UNESCAPED_UNICODE), "info"); goto DXsdG; YLnIK: WC_Pont::log("Export: get labels" . " tr: " . implode(", ", $trs) . " url: " . $url, "info"); goto ZMXei; tqxYP: $query .= "&labelType=" . get_option("wc_pont_posta_labeltype", "A5"); goto qz0l4; PZrzg: $body = json_encode($parcels); goto aEHe0; f3Egz: WC_Pont::log("Export: get labels" . " order id: " . implode(", ", $trs) . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "error"); goto lrmvF; DXsdG: if (!(200 != check_response($resp, $order_id))) { goto m1KqE; } goto IWl1N; w9Sj4: GWm_q: goto DfyFV; O1GOj: if (!$trs) { goto xIU4Y; } goto olqSD; hSI2S: bwzfn: goto WU6ri; cJx6C: return get_transient("pont_pcls") && count(get_transient("pont_pcls")); goto cr0U4; qz0l4: $url = "https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/label?" . $query; goto YLnIK; ilyZS: WC_Pont::update_order_status($PrintLabelsInfoList->PrintLabelsInfo->ClientReference); goto w9Sj4; DfyFV: if (!("yes" === get_option("wc_pont_posta_close"))) { goto jxh9g; } goto cJx6C; cr0U4: jxh9g: goto q2b13; ZDagh: return; goto Cagki; Z5jFu: $exp = 0; goto cBay1; DApIi: $csomag->init(); goto IkQ3d; qnUcJ: if (!(200 != check_response($resp, $order_id))) { goto AgEL2; } goto f3Egz; Cagki: YtfHO: goto iESFq; TFNTH: $params = array("timeout" => apply_filters("wc_pont_export_posta_timeout", 10), "httpversion" => "1.1", "body" => $body, "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto AepFN; CSfde: foreach ($resp as $r) { goto g42mU; tbOWb: WC_Pont::st_array("pont_pcls", $parcels[$i]->orderId, $r->trackingNumber); goto MDEtM; Vsvov: BzEyc: goto N0Hl7; g42mU: if (!isset($r->errors)) { goto XlWWB; } goto IIY7V; uBxE7: goto BzEyc; goto D2v6I; IIY7V: WC_Pont::st_array("pont_errors", $parcels[$i]->orderId, sprintf("%s. MPL \xc3\241ltal k\xc3\xbcld\xc3\266tt hibak\303\xb3d: %s. Hibale\xc3\xadr\303\241s: %s", __("C\303\255mkenyomtatat\303\xa1si probl\xc3\251ma", "wc-pont"), implode(", ", array_column($r->errors, "code")), implode(", ", array_column($r->errors, "text")))); goto Nbp9m; kWV0l: $i++; goto Vsvov; Nbp9m: $i++; goto uBxE7; MDEtM: $trs[$parcels[$i]->orderId] = $r->trackingNumber; goto kWV0l; D2v6I: XlWWB: goto tbOWb; N0Hl7: } goto ZdBA7; olqSD: $params = array("timeout" => 10, "httpversion" => "1.1", "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto O8hHJ; dzHma: $i = 0; goto ChaIy; hgXoL: } goto SIfem; SIfem: function posta_shipments_close($params_body = "{}") { goto onp_M; sk3ZP: $csomag->init(); goto MyUNw; gBzZS: return; goto XIBRo; XIBRo: mtc9G: goto g4Vg2; LTn4U: $resp = wp_remote_post("https://" . $csomag->env . ".api.posta.hu/v2/mplapi/shipments/close", http_build_query($params)); goto Ofug8; urV_P: $csomag = new posta(); goto sk3ZP; HibW6: $filename = date("Ymd-His") . "-sz\303\241ll\303\xadt\xc3\xb3lev\xc3\xa9l.pdf"; goto PIFt6; Ofug8: if (!(200 != check_response($resp, 0))) { goto mtc9G; } goto UT0IK; g4Vg2: $resp = json_decode(wp_remote_retrieve_body($resp)); goto HibW6; MyUNw: $csomag->get_access(); goto seIP3; g6G5w: $pont_pdf2[] = $filename; goto mJ7G1; PIFt6: file_put_contents(trailingslashit(WC_Pont::wc_pont_upload_dir()) . $filename, base64_decode($resp[0]->manifest)); goto g6G5w; UT0IK: WC_Pont::st_array("pont_errors", "Posta", __("Hiba a jegyz\xc3\251k z\303\241r\303\xa1sa sor\303\xa1n", "wc-pont") . ": " . json_encode($resp->errors)); goto gBzZS; onp_M: WC_Pont::log("Posta close shipments", "info"); goto urV_P; seIP3: $params = array("timeout" => 20, "httpversion" => "1.1", "body" => $params_body, "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto LTn4U; mJ7G1: set_transient("pont_pdf2", $pont_pdf2, 5 * MINUTE_IN_SECONDS); goto f7YLK; f7YLK: } goto gLEY7; c1Yzg: if (is_admin()) { goto gAT8G; } goto sJCzu; gLEY7: function get_posta_tracking_info($pn, $order_id) { goto CUCcO; x2xHX: $tracking = (object) ["date" => "Friss\xc3\255tve: " . date("Y-m-d H:i", current_time("timestamp")), "code" => 0, "category" => '', "event" => __("Nincs adat", "wc-pont"), "location" => '']; goto tP4ps; KNK7z: return tracking_data_html($pn, $tracking, "Posta"); goto GpYpB; s1xGf: WC_Pont::log("Posta sent tracking query: " . json_encode($query, JSON_UNESCAPED_UNICODE), "info"); goto Bd5Dr; qHMns: if (!$tracking) { goto yWd0Y; } goto fgqnD; WCBEv: if (!(200 != $respcode)) { goto JFrGB; } goto NQabW; jVB35: $tracking = (object) ["date" => date("Y-m-d H:i", strtotime($status[0]->c11 . " " . $status[0]->c12)), "code" => array_search($status[0]->c9, WC_Pont::$postaTrCodes), "category" => $status[0]->c43, "event" => $status[0]->c9, "location" => $status[0]->c13 ? $status[0]->c13 : '']; goto rH7fm; I82cf: WC_Pont::log("Posta tracking response" . " tr: " . $pn . " response: " . json_encode($resp, JSON_UNESCAPED_UNICODE), "info"); goto CUDwX; Vz_PN: $body = ["language" => "hu", "ids" => $pn, "state" => "last"]; goto FhtM3; pc9jV: $respcode = wp_remote_retrieve_response_code($resp); goto WCBEv; u2UER: hIiDz: goto jVB35; FhtM3: $params = array("timeout" => 10, "httpversion" => "1.1", "body" => json_encode($body), "headers" => ["accept" => "application/json", "Content-Type" => "application/json", "X-Request-Id" => get_uuid(), "X-Accounting-Code" => $csomag->acc, "Authorization" => "Bearer " . $csomag->access_token]); goto ICPQO; CUCcO: $tracking = get_transient("pont_tacking_" . $pn); goto qHMns; Kyh2w: $resp = json_decode(wp_remote_retrieve_body($resp)); goto I82cf; SlOs_: if (!empty($status)) { goto hIiDz; } goto x2xHX; orpn_: $time = date("H:i:s", $timeout - time()); goto kQHuS; d5iY7: return tracking_data_html($pn, $tracking, "Posta"); goto u2UER; DzI3b: $csomag->init(); goto aI29t; ICPQO: $query = http_build_query($params); goto s1xGf; aI29t: $csomag->get_access(); goto Vz_PN; aOu66: yWd0Y: goto VsQkq; VsQkq: $csomag = new posta(); goto DzI3b; SMWYG: return array(sprintf("<a class="posta error" target="_blank" title="%s" href="%s" >%s</a>", __("Kapcsol\303\263d\303\xa1si hiba", "wc-pont"), "https://www.posta.hu/nyomkovetes/nyitooldal?searchvalue=" . $pn, __("Nincs adat", "wc-pont"), __("Nincs adat", "wc-pont")), 0); goto k3rLa; tP4ps: set_transient("pont_tacking_" . $pn, $tracking, 15 * MINUTE_IN_SECONDS); goto d5iY7; EFhA8: return tracking_data_html($pn, $tracking, "Tran"); goto aOu66; fgqnD: $timeout = get_option("_transient_timeout_" . "pont_tacking_" . $pn); goto orpn_; rH7fm: set_transient("pont_tacking_" . $pn, $tracking, 1 * HOUR_IN_SECONDS); goto LOKZa; kQHuS: WC_Pont::log("Posta tracking data by transient. Tracking number: " . $pn . "Order id: " . $order_id . " time: " . $time, "info"); goto EFhA8; CUDwX: $status = $resp->trackAndTrace; goto SlOs_; k3rLa: JFrGB: goto Kyh2w; NQabW: WC_Pont::log("Posta tracking response: " . wc_print_r($resp, true), "error"); goto SMWYG; LOKZa: update_post_meta($order_id, "_tracking_data", $tracking); goto KNK7z; Bd5Dr: $resp = wp_remote_post("https://" . $csomag->env . ".api.posta.hu/v2/nyomkovetes/registered", $query); goto pc9jV; GpYpB: } goto Qugjz; m4XUA: function get_contents($order) { goto hZAPP; mfehv: nMZ9c: goto hxVVR; hxVVR: return $contents; goto pQZXM; mWxiC: foreach ($order->get_items() as $key => $item) { goto B74Yf; algF6: $contents[$key]["qty"] = $item["qty"]; goto qvuQm; jec3a: $contents[$key]["name"] = $product->get_name(); goto psFeF; qvuQm: XQAqD: goto YF979; psFeF: $contents[$key]["sku"] = $product->get_sku(); goto algF6; B74Yf: $product = $item["variation_id"] ? new WC_Product_Variation($item["variation_id"]) : ($product = new WC_Product($item["product_id"])); goto jec3a; YF979: } goto mfehv; hZAPP: $contents = array(); goto mWxiC; pQZXM: } goto MXLO2; sJCzu: return; goto Y6VRx; Y6VRx: gAT8G: goto bCG2m; Qugjz: function tracking_data_html($pn, $tracking, $info) { return array(sprintf("<a class="posta s%s" target="_blank" title="%s" href="%s" data-info="%s">%s</a>", $tracking->category, $tracking->date . " " . $tracking->location, sprintf(WC_Pont::$trk_urls["posta"], $pn), $info, $tracking->event), $tracking->code); } goto qI5y2; bCG2m: class shipments_table extends WP_List_Table { public $parcels = array(); public $pagination = 50; public function prepare_items() { goto hHt81; apQ2F: $this->items = $data; goto gDlt8; fvqmd: $data = array_slice($this->parcels, ($currentPage - 1) * $this->pagination, $this->pagination); goto ovBA9; ovBA9: $this->_column_headers = array($columns, $hidden, $sortable); goto apQ2F; yaabV: $sortable = $this->get_sortable_columns(); goto RBENO; znJbB: $hidden = $this->get_hidden_columns(); goto yaabV; hHt81: $columns = $this->get_columns(); goto znJbB; j8eNO: $this->set_pagination_args(array("total_items" => count($this->parcels), "per_page" => $this->pagination)); goto eB_5u; eB_5u: $currentPage = $this->get_pagenum(); goto fvqmd; RBENO: usort($this->parcels, array(&$this, "sort_data")); goto j8eNO; gDlt8: } public function get_columns() { $columns = array("pn" => __("Ragsz\xc3\xa1m", "wc-pont"), "date" => __("D\303\xa1tum", "wc-pont"), "order_id" => __("Rendel\xc3\251s sz\303\xa1ma", "wc-pont"), "recipient_name" => __("C\303\xadmzett", "wc-pont"), "recipient_contact" => __("El\303\251rhet\305\x91s\303\xa9g", "wc-pont"), "recipient_address" => __("C\xc3\xadm", "wc-pont"), "items" => __("Csomagok", "wc-pont")); return $columns; } public function get_hidden_columns() { return array(); } public function get_sortable_columns() { return array("title" => array("title", false)); } public function column_default($item, $column_name) { goto GxuxI; GxuxI: switch ($column_name) { case "pn": case "date": case "order_id": case "recipient_name": case "recipient_contact": case "recipient_address": case "items": return $item[$column_name]; default: return print_r($item, true); } goto HzKNi; ZYPOa: cyDsz: goto v_9Oo; HzKNi: r4oUm: goto ZYPOa; v_9Oo: } private function sort_data($a, $b) { goto zsQSG; SkiH_: AuW8V: goto k6j7I; k6j7I: $result = strcmp($a[$orderby], $b[$orderby]); goto cvTcf; GpdgV: MEtiL: goto fjzzA; kttKv: $orderby = $_GET["orderby"]; goto y9Oy7; cvTcf: if (!($order === "asc")) { goto MEtiL; } goto cceEt; y9Oy7: ppGgE: goto OFpwu; fjzzA: return -$result; goto Y4Sgb; OFpwu: if (empty($_GET["order"])) { goto AuW8V; } goto t8FvD; cceEt: return $result; goto GpdgV; GkEka: if (empty($_GET["orderby"])) { goto ppGgE; } goto kttKv; zsQSG: $orderby = "date"; goto A6waY; A6waY: $order = "desc"; goto GkEka; t8FvD: $order = $_GET["order"]; goto SkiH_; Y4Sgb: } } ?>
Function Calls
None |
Stats
MD5 | 7f7308163932e39704cb2a4aa1743f20 |
Eval Count | 0 |
Decode Time | 49 ms |