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 /* __________________________________________________ | Obfuscated by YAK P..
Decoded Output download
<?php
/* __________________________________________________
| Obfuscated by YAK Pro - Php Obfuscator 2.0.14 |
| on 2023-07-19 20:38:45 |
| GitHub: https://github.com/pk-fr/yakpro-po |
|__________________________________________________|
*/
class WoocommerceService { private $apiUrl; private $apiKey; private $apiSecret; private $dbService; private $productsUrl; private $productCategoryUrl; private $productImagesUrl; private $sqlFindByMetaData = "SELECT PREFIXpostmeta.post_id " . "FROM PREFIXpostmeta " . "WHERE PREFIXpostmeta.meta_key = %s " . "AND PREFIXpostmeta.meta_value like %ss;"; private $sqlFindNewArrivalsCategory = "SELECT term_id " . "FROM PREFIXterms " . "WHERE name = 'New Arrivals';"; private $sqlFindCategoryByName = "SELECT term_id " . "FROM PREFIXterms " . "WHERE name = %s;"; public function __construct($ptQKx, $NTlC2, $JQxZU, $QSwl2) { $this->apiUrl = $ptQKx; $this->apiKey = $NTlC2; $this->apiSecret = $JQxZU; $this->dbService = $QSwl2; $this->productsUrl = $this->apiUrl . "/wp-json/wc/v2/products"; $this->productCategoryUrl = $this->productsUrl . "/categories"; } public function dbService() { return $this->dbService; } public function setDBPrefix($tt9TN) { global $wpdb; return str_replace("PREFIX", $wpdb->prefix, $tt9TN); } public function getProducts($XTUjZ = 1) { $Lrkrz = $this->productsUrl . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret . "&page=" . $XTUjZ . "&per_page=100"; $nvqq5 = Httpful\Request::get($Lrkrz)->timeoutIn(60)->expectsJson()->authenticateWith($this->apiKey, $this->apiSecret)->send(); return $nvqq5->body; } public function createProduct($mDtfd) { $nvqq5 = Httpful\Request::post($this->productsUrl . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->body(json_encode($mDtfd))->send(); return $nvqq5->body; } public function addProductVariants($FQJhS) { $WJDsF = array(); $huDn4 = $this->getProductVariants($FQJhS->id); if (!(count($huDn4) > 0)) { goto KGsQo; } foreach ($huDn4 as $F6luc) { $WJDsF[] = $F6luc->id; giDEu: } RsEiM: $this->deleteVariantsById($FQJhS, $WJDsF); KGsQo: $LvGze = $this->getUnitAttributeId(); $huDn4 = array("create" => array()); foreach ($FQJhS->variants as $zi1ky => $F6luc) { $pBB8e = $F6luc["price"]; $huDn4["create"][] = array("regular_price" => $F6luc["regular_price"], "sale_price" => $F6luc["sale_price"], "date_on_sale_from" => $F6luc["date_on_sale_from"], "date_on_sale_to" => $F6luc["date_on_sale_to"], "attributes" => array(array("id" => $LvGze, "option" => $F6luc["unit"]))); wdHLA: } t0Bt4: printf("create variant array==>
" . print_r($huDn4, true)); $nvqq5 = Httpful\Request::post($this->productsUrl . "/" . $FQJhS->id . "/variations/batch" . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->body(json_encode($huDn4))->send(); if (is_null($nvqq5->body->data->status)) { goto G8QOC; } $this->throwException($nvqq5, true); G8QOC: } public function deleteVariantsById($FQJhS, $WJDsF) { $huDn4 = array("delete" => array()); foreach ($WJDsF as $RLc6y) { $huDn4["delete"][] = intval($RLc6y); xQGxv: } xj1ZK: $EOa2w = $this->productsUrl . "/" . $FQJhS->id . "/variations/batch"; $nvqq5 = $this->doPost($EOa2w, $huDn4); } public function getProductVariants($eKGcq) { $EOa2w = $this->productsUrl . "/" . $eKGcq . "/variations"; $nvqq5 = $this->doGet($EOa2w); return $nvqq5->body; } public function getProductAttributes() { $nvqq5 = Httpful\Request::get($this->productsUrl . "/attributes" . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->send(); return $nvqq5->body; } public function getProductAttributeTerms($aTFFU) { $nvqq5 = Httpful\Request::get($this->productsUrl . "/attributes/" . $aTFFU . "/terms" . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret . "&page=1&per_page=100")->timeoutIn(60)->expectsJson()->send(); return $nvqq5->body; } public function updateProduct($mDtfd) { $nvqq5 = Httpful\Request::put($this->productsUrl . "/" . $mDtfd->id . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($mDtfd))->send(); if (!(isset($nvqq5->body->data->status) && !is_null($nvqq5->body->data->status))) { goto rnEdx; } error_log("$response->body->data->status is not null" . "
"); error_log("$response->body->data->status: " . $nvqq5->body->data->status . "
"); error_log("$response->body->message: " . $nvqq5->body->message . "
"); $this->throwException($nvqq5, true); rnEdx: if (!(isset($mDtfd) && isset($mDtfd->variants) && count($mDtfd->variants) > 0)) { goto vQ_Uh; } try { $this->addProductVariants($mDtfd); } catch (Exception $dO__X) { error_log("something went wrong with addProductVariant
"); var_dump($dO__X); } vQ_Uh: return $nvqq5->body; } public function createProductsFrom($bHxJQ) { $ramYS = array(); foreach ($bHxJQ as $kRD8J) { array_push($ramYS, self::map($kRD8J)); Usyf0: } pqq8u: $RVjun = array("create" => $ramYS); $nvqq5 = Httpful\Request::post($this->productsUrl . "/batch" . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($RVjun))->send(); return $nvqq5->body; } public function getProductById($RLc6y) { $Lrkrz = $this->productsUrl . "/" . $RLc6y . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret . "&page=1&per_page=100"; $nvqq5 = Httpful\Request::get($Lrkrz)->timeoutIn(60)->expectsJson()->authenticateWith($this->apiKey, $this->apiSecret)->send(); return $nvqq5->body; } public function findBySku($CJfpj) { $xFI08 = $this->dbService->queryWithMeta($this->setDBPrefix($this->sqlFindByMetaData), "_sku", $CJfpj); return $this->getProductById($xFI08[0]["post_id"]); } public function findByNcrItemNo($KQUHl) { error_log("wc237 " . $this->sqlFindByMetaData); error_log("wc238 " . $this->setDBPrefix($this->sqlFindByMetaData)); $xFI08 = $this->dbService->queryWithMeta($this->setDBPrefix($this->sqlFindByMetaData), "NCR_ITEM_NO", $KQUHl); error_log("wc240"); if (!(count($xFI08) == 0)) { goto Ik9Nn; } return null; Ik9Nn: error_log("wc243 - " . $xFI08); return $this->getProductById($xFI08[0]["post_id"]); } public function deleteAllProductsAndCategories() { $x5xSC = $this->getProducts(); $WJDsF = array(); if (is_countable($x5xSC)) { goto BBAF6; } error_log("Invalid response for products"); goto Cc6iw; BBAF6: Ng2bB: if (!(count($x5xSC) > 0)) { goto Eq0Pl; } foreach ($x5xSC as $l_ndH) { array_push($WJDsF, $l_ndH->id); jIzh_: } BEytn: $nvqq5 = $this->deleteProductsById($WJDsF); $x5xSC = $this->getProducts(); $WJDsF = array(); goto Ng2bB; Eq0Pl: Cc6iw: $XVlv2 = $this->getCategories(); $rqtWL = 0; $WJDsF = array(); if (!is_countable($XVlv2)) { goto rnFY2; } xJ5vm: if (!(count($XVlv2) > $rqtWL)) { goto XtmiW; } foreach ($XVlv2 as $jc4d6) { if ($jc4d6->display == "default") { goto q307t; } array_push($WJDsF, $jc4d6->id); goto LpfUw; q307t: $rqtWL++; LpfUw: mlqEX: } JZe_L: if (empty($WJDsF)) { goto fURjz; } $nvqq5 = $this->deleteCategoriesById($WJDsF); fURjz: $XVlv2 = $this->getCategories(); $WJDsF = array(); goto xJ5vm; XtmiW: rnFY2: } public function deleteProductsById($WJDsF) { $NJndG = array("delete" => $WJDsF); $nvqq5 = Httpful\Request::post($this->productsUrl . "/batch" . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret . "&page=1&per_page=100")->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($NJndG))->send(); return $nvqq5->body; } public function deleteCategoriesById($WJDsF) { $NJndG = array("delete" => $WJDsF); $nvqq5 = Httpful\Request::post($this->productCategoryUrl . "/batch" . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret . "&page=1&per_page=100")->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($NJndG))->send(); return $nvqq5->body; } public function getCategories() { $nvqq5 = Httpful\Request::get($this->productCategoryUrl . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->send(); var_dump($nvqq5->body); return $nvqq5->body; } public function getCategoryByDescription($UB03x) { $XVlv2 = $this->getCategories(); foreach ($XVlv2 as $jc4d6) { if (!($jc4d6->description == $UB03x)) { goto dstHI; } return $jc4d6; dstHI: t6Onb: } AUKda: return null; } public function createCategory($jc4d6) { $nvqq5 = Httpful\Request::post($this->productCategoryUrl . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->body(json_encode($jc4d6))->send(); return $nvqq5->body; } public function findNewArrivalsCategory() { return $this->findCategoryByName("New Arrivals"); } public function findOnSpecialCategory() { return $this->findCategoryByName("On Special"); } public function findCategoryByName($HW3D2) { $xFI08 = $this->dbService->queryWithParameter($this->setDBPrefix($this->sqlFindCategoryByName), $HW3D2); if (!(count($xFI08) == 0)) { goto EnISH; } return NULL; EnISH: $jc4d6 = $this->findCategoryById($xFI08[0]["term_id"]); return $jc4d6; } public function findCategoryById($RLc6y) { $nvqq5 = Httpful\Request::get($this->productCategoryUrl . "/" . $RLc6y . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->send(); return $nvqq5->body; } public function findFirstProductByMeta($ODgh2, $caQ61) { $x5xSC = array(); $sEY2C = $this->dbService->queryWithMeta($this->setDBPrefix($this->sqlFindByMetaData), $ODgh2, $caQ61); if (!(is_null($sEY2C) || count($sEY2C) == 0)) { goto OsNXy; } return NULL; OsNXy: $l_ndH = $this->getProductById($sEY2C[0]["post_id"]); return $l_ndH; } public function getOrderItems($l9I4f) { $gDNgp = wc_get_order($l9I4f); error_log("DEBUG WC ORDER: " . $gDNgp); $ZOe43->customerId = $gDNgp->customer_id; $ZOe43->billing->fullName = $gDNgp->get_formatted_billing_full_name(); $ZOe43->billing->firstName = $gDNgp->get_billing_first_name(); $ZOe43->billing->lastName = $gDNgp->get_billing_last_name(); $ZOe43->billing->address1 = $gDNgp->get_billing_address_1(); $ZOe43->billing->city = $gDNgp->get_billing_city(); $ZOe43->billing->zip = $gDNgp->get_billing_postcode(); $ZOe43->billing->state = $gDNgp->get_billing_state(); $ZOe43->billing->country = $gDNgp->get_billing_country(); $ZOe43->billing->phone1 = $gDNgp->get_billing_phone(); $ZOe43->billing->namTyp = "P"; $ZOe43->billing->email = $gDNgp->get_billing_email(); $gDNgp->shipping->fullName = $gDNgp->get_formatted_shipping_full_name(); $ZOe43->shipping->firstName = $gDNgp->get_shipping_first_name(); $ZOe43->shipping->lastName = $gDNgp->get_shipping_last_name(); $ZOe43->shipping->address1 = $gDNgp->get_shipping_address_1(); $ZOe43->shipping->city = $gDNgp->get_shipping_city(); $ZOe43->shipping->zip = $gDNgp->get_shipping_postcode(); $ZOe43->shipping->state = $gDNgp->get_shipping_state(); $ZOe43->shipping->country = $gDNgp->get_shipping_country(); $ZOe43->shipping->namTyp = "P"; $b10rF = array(); if (!$gDNgp) { goto gCeEH; } foreach ($gDNgp->get_items() as $q6Dil => $B4R5V) { $mA7wf->line_type = "O"; error_log("DEBUG W: " . $B4R5V); $l_ndH = $B4R5V->get_product(); error_log("DEBUG W2: " . $l_ndH); $imLQh = $l_ndH->get_meta_data(); error_log("DEBUG W3: " . json_encode($imLQh)); $GY0Qb = ''; foreach ($imLQh as $DJ_fN) { if (!($DJ_fN->key == "NCR_ITEM_NO")) { goto K1Kdi; } $GY0Qb = $DJ_fN->value; error_log("DEBUG W4: " . $GY0Qb); K1Kdi: Z9q1r: } ncNku: if (!($l_ndH->parent_id > 0)) { goto cSLIK; } $BJsZR = wc_get_product($l_ndH->parent_id); $Koxuf = $BJsZR->get_meta_data(); foreach ($Koxuf as $DJ_fN) { if (!($DJ_fN->key == "NCR_ITEM_NO")) { goto vkAcp; } $GY0Qb = $DJ_fN->value; error_log("DEBUG W4a: " . $GY0Qb); vkAcp: A0AEo: } LTXmY: cSLIK: $mA7wf->item_number = $GY0Qb; $mA7wf->quantity = $B4R5V->get_quantity(); $mA7wf->price = $B4R5V->get_total(); array_push($b10rF, clone $mA7wf); drOrE: } LqCXN: gCeEH: $ZOe43->items = $b10rF; return $ZOe43; } public function updateWcOrder($l9I4f, $VvIGm) { $VvIGm = json_decode($VvIGm); if (!($VvIGm->ErrorCode == "SUCCESS")) { goto fZ_E8; } $gDNgp = wc_get_order($l9I4f); $gDNgp->add_meta_data("ncrDocId", $VvIGm->Documents[0]->DOC_ID, true); $gDNgp->save_meta_data(); fZ_E8: } public function doGet($EOa2w, $FPod1 = NULL) { $EJEHq = Httpful\Request::get($EOa2w . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->expectsJson(); if (is_null($FPod1)) { goto Jrzcu; } $EJEHq->body($FPod1); Jrzcu: return $EJEHq->send(); } private function doPost($EOa2w, $FPod1 = NULL) { $ltlTx = Httpful\Request::post($EOa2w . "?consumer_key=" . $this->apiKey . "&consumer_secret=" . $this->apiSecret)->timeoutIn(60)->sendsJson()->expectsJson(); if (!is_null($FPod1)) { goto WfPWN; } $nvqq5 = $ltlTx->send(); goto E0DDa; WfPWN: $nvqq5 = $ltlTx->body(json_encode($FPod1))->send(); E0DDa: printf("web service response===>\xa"); var_dump($nvqq5); printf("end of response====>
"); return $nvqq5->body; } private function getUnitAttributeId() { $Ik7nV = $this->getProductAttributes(); foreach ($Ik7nV as $zi1ky => $Qnxl1) { if (!($Qnxl1->name == "Unit")) { goto OdLR8; } return $Qnxl1->id; OdLR8: AKPRI: } ttdyK: } private function throwException($nvqq5, $vtTNz = false) { $TEwTs = "WooCommerce REST Exception" . "\xa message: " . $nvqq5->body->message . "\xa code: " . $nvqq5->body->code . "\xahttp status code: " . $nvqq5->body->data->status; if (!$vtTNz) { goto H8bcx; } $TEwTs = $TEwTs . "\xa response: " . print_r($nvqq5, true); H8bcx: throw new Exception($TEwTs); } }
?>
Did this file decode correctly?
Original Code
<?php
/* __________________________________________________
| Obfuscated by YAK Pro - Php Obfuscator 2.0.14 |
| on 2023-07-19 20:38:45 |
| GitHub: https://github.com/pk-fr/yakpro-po |
|__________________________________________________|
*/
class WoocommerceService { private $apiUrl; private $apiKey; private $apiSecret; private $dbService; private $productsUrl; private $productCategoryUrl; private $productImagesUrl; private $sqlFindByMetaData = "\123\105\x4c\x45\103\124\40\x50\122\x45\106\111\130\x70\157\163\164\x6d\x65\164\141\56\x70\157\x73\164\x5f\x69\144\40" . "\106\x52\x4f\x4d\x20\x50\x52\105\106\x49\130\160\x6f\163\164\155\145\x74\141\x20" . "\127\110\105\x52\105\x20\x50\x52\105\x46\111\130\x70\157\x73\x74\x6d\x65\x74\141\x2e\155\145\x74\141\137\x6b\145\171\40\x3d\40\x25\163\40" . "\x41\116\x44\x20\120\x52\x45\106\x49\x58\x70\157\x73\164\x6d\x65\164\x61\56\x6d\145\x74\141\x5f\166\141\154\x75\x65\x20\x6c\151\153\145\x20\x25\x73\163\x3b"; private $sqlFindNewArrivalsCategory = "\123\x45\114\x45\x43\124\x20\164\145\162\x6d\137\x69\144\40" . "\x46\122\117\x4d\40\x50\122\105\x46\x49\130\164\x65\162\155\x73\40" . "\127\110\105\x52\105\x20\x6e\141\x6d\x65\40\75\40\x27\116\145\x77\40\x41\162\162\151\166\x61\154\163\x27\x3b"; private $sqlFindCategoryByName = "\x53\105\x4c\105\103\124\x20\164\145\162\155\137\x69\x64\40" . "\106\x52\x4f\x4d\40\120\122\105\x46\x49\x58\x74\x65\x72\x6d\163\40" . "\127\x48\105\x52\x45\x20\156\141\155\145\x20\75\x20\x25\163\73"; public function __construct($ptQKx, $NTlC2, $JQxZU, $QSwl2) { $this->apiUrl = $ptQKx; $this->apiKey = $NTlC2; $this->apiSecret = $JQxZU; $this->dbService = $QSwl2; $this->productsUrl = $this->apiUrl . "\57\167\160\55\152\163\x6f\156\x2f\167\x63\x2f\x76\x32\x2f\x70\x72\x6f\x64\165\x63\x74\x73"; $this->productCategoryUrl = $this->productsUrl . "\57\143\x61\164\145\x67\x6f\x72\151\x65\163"; } public function dbService() { return $this->dbService; } public function setDBPrefix($tt9TN) { global $wpdb; return str_replace("\x50\x52\x45\x46\x49\130", $wpdb->prefix, $tt9TN); } public function getProducts($XTUjZ = 1) { $Lrkrz = $this->productsUrl . "\77\x63\x6f\156\163\165\x6d\145\x72\137\x6b\x65\171\75" . $this->apiKey . "\46\143\157\x6e\163\x75\x6d\145\x72\137\163\145\x63\162\145\164\x3d" . $this->apiSecret . "\46\160\x61\147\x65\x3d" . $XTUjZ . "\x26\x70\x65\162\137\x70\141\x67\145\75\61\x30\x30"; $nvqq5 = Httpful\Request::get($Lrkrz)->timeoutIn(60)->expectsJson()->authenticateWith($this->apiKey, $this->apiSecret)->send(); return $nvqq5->body; } public function createProduct($mDtfd) { $nvqq5 = Httpful\Request::post($this->productsUrl . "\x3f\x63\x6f\156\163\165\x6d\x65\162\137\x6b\145\171\75" . $this->apiKey . "\x26\143\x6f\x6e\x73\165\x6d\145\x72\137\x73\x65\143\162\x65\164\x3d" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->body(json_encode($mDtfd))->send(); return $nvqq5->body; } public function addProductVariants($FQJhS) { $WJDsF = array(); $huDn4 = $this->getProductVariants($FQJhS->id); if (!(count($huDn4) > 0)) { goto KGsQo; } foreach ($huDn4 as $F6luc) { $WJDsF[] = $F6luc->id; giDEu: } RsEiM: $this->deleteVariantsById($FQJhS, $WJDsF); KGsQo: $LvGze = $this->getUnitAttributeId(); $huDn4 = array("\143\x72\145\x61\164\x65" => array()); foreach ($FQJhS->variants as $zi1ky => $F6luc) { $pBB8e = $F6luc["\160\162\x69\143\145"]; $huDn4["\x63\162\145\141\x74\145"][] = array("\162\x65\x67\x75\x6c\x61\162\x5f\160\x72\151\x63\145" => $F6luc["\x72\x65\147\x75\154\x61\x72\137\x70\x72\x69\143\145"], "\163\x61\x6c\x65\137\160\x72\151\x63\x65" => $F6luc["\163\141\154\145\137\x70\162\x69\143\145"], "\x64\x61\x74\x65\137\x6f\156\x5f\x73\141\154\145\137\x66\x72\157\155" => $F6luc["\144\x61\164\x65\137\x6f\x6e\x5f\163\141\x6c\x65\137\x66\162\157\x6d"], "\x64\141\164\x65\137\157\x6e\137\x73\141\x6c\145\137\164\x6f" => $F6luc["\144\x61\164\x65\x5f\157\156\x5f\x73\x61\154\145\137\164\x6f"], "\141\164\x74\x72\151\x62\165\x74\x65\x73" => array(array("\151\144" => $LvGze, "\157\x70\x74\151\157\156" => $F6luc["\x75\x6e\x69\164"]))); wdHLA: } t0Bt4: printf("\143\162\145\x61\164\x65\x20\166\x61\x72\151\x61\156\164\x20\x61\x72\x72\x61\x79\75\x3d\x3e\12" . print_r($huDn4, true)); $nvqq5 = Httpful\Request::post($this->productsUrl . "\x2f" . $FQJhS->id . "\57\x76\141\x72\x69\141\x74\x69\157\x6e\163\57\142\x61\164\x63\x68" . "\x3f\143\x6f\x6e\x73\165\x6d\x65\162\137\153\145\x79\75" . $this->apiKey . "\x26\x63\157\156\x73\x75\x6d\x65\x72\x5f\x73\145\143\x72\x65\x74\x3d" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->body(json_encode($huDn4))->send(); if (is_null($nvqq5->body->data->status)) { goto G8QOC; } $this->throwException($nvqq5, true); G8QOC: } public function deleteVariantsById($FQJhS, $WJDsF) { $huDn4 = array("\144\x65\154\145\164\x65" => array()); foreach ($WJDsF as $RLc6y) { $huDn4["\x64\x65\154\145\164\x65"][] = intval($RLc6y); xQGxv: } xj1ZK: $EOa2w = $this->productsUrl . "\57" . $FQJhS->id . "\57\166\141\x72\x69\141\164\x69\x6f\x6e\163\57\x62\141\x74\143\x68"; $nvqq5 = $this->doPost($EOa2w, $huDn4); } public function getProductVariants($eKGcq) { $EOa2w = $this->productsUrl . "\57" . $eKGcq . "\x2f\166\x61\x72\151\141\164\151\157\x6e\x73"; $nvqq5 = $this->doGet($EOa2w); return $nvqq5->body; } public function getProductAttributes() { $nvqq5 = Httpful\Request::get($this->productsUrl . "\57\141\164\x74\x72\x69\142\x75\x74\145\x73" . "\77\x63\157\156\x73\x75\155\145\162\137\x6b\145\x79\75" . $this->apiKey . "\x26\x63\157\x6e\163\165\155\x65\x72\x5f\163\x65\143\162\x65\164\x3d" . $this->apiSecret)->timeoutIn(60)->expectsJson()->send(); return $nvqq5->body; } public function getProductAttributeTerms($aTFFU) { $nvqq5 = Httpful\Request::get($this->productsUrl . "\57\141\164\x74\162\151\142\x75\164\145\163\57" . $aTFFU . "\x2f\164\145\x72\155\163" . "\77\x63\x6f\x6e\163\x75\155\145\x72\x5f\x6b\x65\x79\x3d" . $this->apiKey . "\46\143\157\156\x73\x75\155\145\x72\x5f\x73\x65\x63\x72\145\x74\75" . $this->apiSecret . "\46\x70\141\x67\145\x3d\x31\46\x70\x65\162\137\x70\141\x67\145\75\x31\x30\60")->timeoutIn(60)->expectsJson()->send(); return $nvqq5->body; } public function updateProduct($mDtfd) { $nvqq5 = Httpful\Request::put($this->productsUrl . "\x2f" . $mDtfd->id . "\77\143\x6f\156\163\x75\155\145\162\137\x6b\145\171\75" . $this->apiKey . "\x26\x63\x6f\x6e\x73\165\155\145\162\137\163\145\143\x72\145\x74\x3d" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($mDtfd))->send(); if (!(isset($nvqq5->body->data->status) && !is_null($nvqq5->body->data->status))) { goto rnEdx; } error_log("\x24\162\145\x73\160\157\156\x73\x65\55\x3e\142\157\x64\171\x2d\76\x64\141\164\141\55\76\x73\164\141\x74\x75\163\x20\151\x73\40\156\x6f\164\40\x6e\165\x6c\x6c" . "\12"); error_log("\44\162\x65\x73\160\x6f\156\x73\145\55\76\142\157\144\171\55\76\x64\141\164\141\x2d\x3e\x73\164\x61\164\x75\163\x3a\x20\40" . $nvqq5->body->data->status . "\12"); error_log("\x24\x72\145\x73\160\157\x6e\163\x65\x2d\76\142\157\144\x79\x2d\76\155\145\163\163\x61\x67\145\x3a\40\x20" . $nvqq5->body->message . "\12"); $this->throwException($nvqq5, true); rnEdx: if (!(isset($mDtfd) && isset($mDtfd->variants) && count($mDtfd->variants) > 0)) { goto vQ_Uh; } try { $this->addProductVariants($mDtfd); } catch (Exception $dO__X) { error_log("\x73\157\155\x65\x74\150\x69\x6e\147\x20\167\x65\x6e\x74\40\167\162\x6f\x6e\147\40\x77\151\164\x68\x20\x61\x64\x64\x50\162\x6f\x64\165\143\164\126\141\162\151\141\x6e\164\12"); var_dump($dO__X); } vQ_Uh: return $nvqq5->body; } public function createProductsFrom($bHxJQ) { $ramYS = array(); foreach ($bHxJQ as $kRD8J) { array_push($ramYS, self::map($kRD8J)); Usyf0: } pqq8u: $RVjun = array("\143\x72\145\x61\x74\x65" => $ramYS); $nvqq5 = Httpful\Request::post($this->productsUrl . "\57\142\x61\164\143\150" . "\77\x63\x6f\x6e\x73\165\x6d\x65\x72\137\x6b\x65\171\x3d" . $this->apiKey . "\46\143\x6f\x6e\x73\165\x6d\x65\162\x5f\163\x65\x63\x72\145\x74\x3d" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($RVjun))->send(); return $nvqq5->body; } public function getProductById($RLc6y) { $Lrkrz = $this->productsUrl . "\x2f" . $RLc6y . "\77\143\157\x6e\x73\165\x6d\145\162\137\x6b\x65\171\x3d" . $this->apiKey . "\46\x63\157\x6e\163\x75\155\x65\162\137\163\x65\x63\x72\x65\164\x3d" . $this->apiSecret . "\x26\x70\141\147\x65\x3d\61\x26\160\x65\x72\137\160\x61\147\145\75\61\x30\x30"; $nvqq5 = Httpful\Request::get($Lrkrz)->timeoutIn(60)->expectsJson()->authenticateWith($this->apiKey, $this->apiSecret)->send(); return $nvqq5->body; } public function findBySku($CJfpj) { $xFI08 = $this->dbService->queryWithMeta($this->setDBPrefix($this->sqlFindByMetaData), "\137\163\x6b\165", $CJfpj); return $this->getProductById($xFI08[0]["\160\157\163\x74\x5f\151\144"]); } public function findByNcrItemNo($KQUHl) { error_log("\167\143\62\63\67\x20" . $this->sqlFindByMetaData); error_log("\x77\143\x32\63\70\x20" . $this->setDBPrefix($this->sqlFindByMetaData)); $xFI08 = $this->dbService->queryWithMeta($this->setDBPrefix($this->sqlFindByMetaData), "\116\103\122\137\111\124\x45\x4d\x5f\x4e\x4f", $KQUHl); error_log("\x77\x63\62\64\x30"); if (!(count($xFI08) == 0)) { goto Ik9Nn; } return null; Ik9Nn: error_log("\167\143\62\x34\x33\40\55\x20" . $xFI08); return $this->getProductById($xFI08[0]["\160\157\x73\x74\x5f\151\144"]); } public function deleteAllProductsAndCategories() { $x5xSC = $this->getProducts(); $WJDsF = array(); if (is_countable($x5xSC)) { goto BBAF6; } error_log("\x49\156\166\x61\x6c\x69\x64\x20\x72\145\163\160\x6f\156\163\145\x20\146\157\x72\x20\160\162\x6f\144\x75\143\164\163"); goto Cc6iw; BBAF6: Ng2bB: if (!(count($x5xSC) > 0)) { goto Eq0Pl; } foreach ($x5xSC as $l_ndH) { array_push($WJDsF, $l_ndH->id); jIzh_: } BEytn: $nvqq5 = $this->deleteProductsById($WJDsF); $x5xSC = $this->getProducts(); $WJDsF = array(); goto Ng2bB; Eq0Pl: Cc6iw: $XVlv2 = $this->getCategories(); $rqtWL = 0; $WJDsF = array(); if (!is_countable($XVlv2)) { goto rnFY2; } xJ5vm: if (!(count($XVlv2) > $rqtWL)) { goto XtmiW; } foreach ($XVlv2 as $jc4d6) { if ($jc4d6->display == "\144\x65\146\x61\165\154\x74") { goto q307t; } array_push($WJDsF, $jc4d6->id); goto LpfUw; q307t: $rqtWL++; LpfUw: mlqEX: } JZe_L: if (empty($WJDsF)) { goto fURjz; } $nvqq5 = $this->deleteCategoriesById($WJDsF); fURjz: $XVlv2 = $this->getCategories(); $WJDsF = array(); goto xJ5vm; XtmiW: rnFY2: } public function deleteProductsById($WJDsF) { $NJndG = array("\144\x65\x6c\145\164\x65" => $WJDsF); $nvqq5 = Httpful\Request::post($this->productsUrl . "\57\142\x61\x74\143\x68" . "\77\143\157\x6e\163\x75\155\x65\162\x5f\x6b\x65\171\75" . $this->apiKey . "\x26\143\x6f\x6e\x73\165\x6d\145\162\137\163\x65\143\x72\x65\x74\75" . $this->apiSecret . "\x26\x70\x61\147\145\x3d\x31\46\x70\x65\162\137\160\x61\x67\x65\75\61\60\x30")->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($NJndG))->send(); return $nvqq5->body; } public function deleteCategoriesById($WJDsF) { $NJndG = array("\x64\145\x6c\145\164\145" => $WJDsF); $nvqq5 = Httpful\Request::post($this->productCategoryUrl . "\57\142\x61\164\143\x68" . "\x3f\x63\157\x6e\163\x75\x6d\x65\x72\137\153\x65\171\x3d" . $this->apiKey . "\46\x63\x6f\x6e\x73\x75\155\x65\x72\x5f\x73\145\143\x72\x65\x74\x3d" . $this->apiSecret . "\x26\x70\141\x67\x65\x3d\61\46\160\145\x72\x5f\x70\x61\147\145\75\x31\x30\60")->timeoutIn(60)->expectsJson()->sendsJson()->authenticateWith($this->apiKey, $this->apiSecret)->body(json_encode($NJndG))->send(); return $nvqq5->body; } public function getCategories() { $nvqq5 = Httpful\Request::get($this->productCategoryUrl . "\x3f\x63\x6f\156\x73\165\155\145\x72\137\x6b\x65\171\x3d" . $this->apiKey . "\46\143\x6f\156\x73\165\155\145\x72\x5f\x73\x65\143\x72\x65\164\75" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->send(); var_dump($nvqq5->body); return $nvqq5->body; } public function getCategoryByDescription($UB03x) { $XVlv2 = $this->getCategories(); foreach ($XVlv2 as $jc4d6) { if (!($jc4d6->description == $UB03x)) { goto dstHI; } return $jc4d6; dstHI: t6Onb: } AUKda: return null; } public function createCategory($jc4d6) { $nvqq5 = Httpful\Request::post($this->productCategoryUrl . "\77\x63\157\156\x73\x75\x6d\x65\x72\x5f\x6b\x65\171\x3d" . $this->apiKey . "\x26\143\x6f\x6e\163\x75\155\x65\x72\x5f\163\x65\x63\x72\145\164\75" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->body(json_encode($jc4d6))->send(); return $nvqq5->body; } public function findNewArrivalsCategory() { return $this->findCategoryByName("\116\x65\x77\40\101\162\162\x69\x76\141\x6c\163"); } public function findOnSpecialCategory() { return $this->findCategoryByName("\x4f\156\40\123\160\x65\x63\151\141\154"); } public function findCategoryByName($HW3D2) { $xFI08 = $this->dbService->queryWithParameter($this->setDBPrefix($this->sqlFindCategoryByName), $HW3D2); if (!(count($xFI08) == 0)) { goto EnISH; } return NULL; EnISH: $jc4d6 = $this->findCategoryById($xFI08[0]["\x74\x65\162\155\x5f\151\x64"]); return $jc4d6; } public function findCategoryById($RLc6y) { $nvqq5 = Httpful\Request::get($this->productCategoryUrl . "\x2f" . $RLc6y . "\x3f\x63\x6f\156\163\x75\x6d\x65\x72\x5f\x6b\145\x79\x3d" . $this->apiKey . "\46\x63\x6f\x6e\163\x75\x6d\x65\x72\137\163\x65\x63\x72\x65\x74\x3d" . $this->apiSecret)->timeoutIn(60)->expectsJson()->sendsJson()->send(); return $nvqq5->body; } public function findFirstProductByMeta($ODgh2, $caQ61) { $x5xSC = array(); $sEY2C = $this->dbService->queryWithMeta($this->setDBPrefix($this->sqlFindByMetaData), $ODgh2, $caQ61); if (!(is_null($sEY2C) || count($sEY2C) == 0)) { goto OsNXy; } return NULL; OsNXy: $l_ndH = $this->getProductById($sEY2C[0]["\160\157\x73\164\137\151\144"]); return $l_ndH; } public function getOrderItems($l9I4f) { $gDNgp = wc_get_order($l9I4f); error_log("\104\x45\102\125\107\40\x57\103\x20\117\x52\x44\105\x52\72\x20" . $gDNgp); $ZOe43->customerId = $gDNgp->customer_id; $ZOe43->billing->fullName = $gDNgp->get_formatted_billing_full_name(); $ZOe43->billing->firstName = $gDNgp->get_billing_first_name(); $ZOe43->billing->lastName = $gDNgp->get_billing_last_name(); $ZOe43->billing->address1 = $gDNgp->get_billing_address_1(); $ZOe43->billing->city = $gDNgp->get_billing_city(); $ZOe43->billing->zip = $gDNgp->get_billing_postcode(); $ZOe43->billing->state = $gDNgp->get_billing_state(); $ZOe43->billing->country = $gDNgp->get_billing_country(); $ZOe43->billing->phone1 = $gDNgp->get_billing_phone(); $ZOe43->billing->namTyp = "\120"; $ZOe43->billing->email = $gDNgp->get_billing_email(); $gDNgp->shipping->fullName = $gDNgp->get_formatted_shipping_full_name(); $ZOe43->shipping->firstName = $gDNgp->get_shipping_first_name(); $ZOe43->shipping->lastName = $gDNgp->get_shipping_last_name(); $ZOe43->shipping->address1 = $gDNgp->get_shipping_address_1(); $ZOe43->shipping->city = $gDNgp->get_shipping_city(); $ZOe43->shipping->zip = $gDNgp->get_shipping_postcode(); $ZOe43->shipping->state = $gDNgp->get_shipping_state(); $ZOe43->shipping->country = $gDNgp->get_shipping_country(); $ZOe43->shipping->namTyp = "\120"; $b10rF = array(); if (!$gDNgp) { goto gCeEH; } foreach ($gDNgp->get_items() as $q6Dil => $B4R5V) { $mA7wf->line_type = "\117"; error_log("\x44\105\102\125\107\40\x57\72\x20" . $B4R5V); $l_ndH = $B4R5V->get_product(); error_log("\104\x45\x42\125\x47\40\127\62\72\x20" . $l_ndH); $imLQh = $l_ndH->get_meta_data(); error_log("\104\x45\x42\125\x47\40\x57\x33\72\x20" . json_encode($imLQh)); $GY0Qb = ''; foreach ($imLQh as $DJ_fN) { if (!($DJ_fN->key == "\x4e\x43\122\x5f\x49\124\x45\115\x5f\116\x4f")) { goto K1Kdi; } $GY0Qb = $DJ_fN->value; error_log("\104\105\102\125\x47\x20\127\64\x3a\40" . $GY0Qb); K1Kdi: Z9q1r: } ncNku: if (!($l_ndH->parent_id > 0)) { goto cSLIK; } $BJsZR = wc_get_product($l_ndH->parent_id); $Koxuf = $BJsZR->get_meta_data(); foreach ($Koxuf as $DJ_fN) { if (!($DJ_fN->key == "\x4e\x43\x52\x5f\x49\124\105\115\x5f\116\117")) { goto vkAcp; } $GY0Qb = $DJ_fN->value; error_log("\104\105\102\x55\107\x20\x57\x34\141\72\x20" . $GY0Qb); vkAcp: A0AEo: } LTXmY: cSLIK: $mA7wf->item_number = $GY0Qb; $mA7wf->quantity = $B4R5V->get_quantity(); $mA7wf->price = $B4R5V->get_total(); array_push($b10rF, clone $mA7wf); drOrE: } LqCXN: gCeEH: $ZOe43->items = $b10rF; return $ZOe43; } public function updateWcOrder($l9I4f, $VvIGm) { $VvIGm = json_decode($VvIGm); if (!($VvIGm->ErrorCode == "\x53\125\103\x43\105\x53\x53")) { goto fZ_E8; } $gDNgp = wc_get_order($l9I4f); $gDNgp->add_meta_data("\156\143\162\104\157\x63\111\x64", $VvIGm->Documents[0]->DOC_ID, true); $gDNgp->save_meta_data(); fZ_E8: } public function doGet($EOa2w, $FPod1 = NULL) { $EJEHq = Httpful\Request::get($EOa2w . "\x3f\x63\x6f\x6e\163\x75\x6d\145\x72\137\x6b\145\x79\75" . $this->apiKey . "\46\143\157\x6e\x73\165\x6d\x65\162\x5f\x73\145\x63\162\x65\x74\x3d" . $this->apiSecret)->timeoutIn(60)->expectsJson(); if (is_null($FPod1)) { goto Jrzcu; } $EJEHq->body($FPod1); Jrzcu: return $EJEHq->send(); } private function doPost($EOa2w, $FPod1 = NULL) { $ltlTx = Httpful\Request::post($EOa2w . "\x3f\143\157\x6e\163\165\155\145\162\x5f\x6b\x65\171\75" . $this->apiKey . "\x26\x63\157\x6e\163\165\x6d\145\162\x5f\x73\x65\x63\162\x65\164\75" . $this->apiSecret)->timeoutIn(60)->sendsJson()->expectsJson(); if (!is_null($FPod1)) { goto WfPWN; } $nvqq5 = $ltlTx->send(); goto E0DDa; WfPWN: $nvqq5 = $ltlTx->body(json_encode($FPod1))->send(); E0DDa: printf("\167\145\x62\40\x73\145\x72\x76\x69\x63\x65\x20\162\145\163\160\157\x6e\x73\x65\75\75\x3d\76\xa"); var_dump($nvqq5); printf("\x65\156\x64\40\x6f\x66\x20\x72\x65\x73\160\157\x6e\163\x65\x3d\75\75\x3d\76\12"); return $nvqq5->body; } private function getUnitAttributeId() { $Ik7nV = $this->getProductAttributes(); foreach ($Ik7nV as $zi1ky => $Qnxl1) { if (!($Qnxl1->name == "\125\156\x69\164")) { goto OdLR8; } return $Qnxl1->id; OdLR8: AKPRI: } ttdyK: } private function throwException($nvqq5, $vtTNz = false) { $TEwTs = "\127\157\157\x43\157\x6d\x6d\145\x72\143\145\40\122\105\123\x54\40\x45\170\x63\x65\x70\x74\151\157\156" . "\xa\40\40\x20\40\x20\x20\40\x20\x20\x6d\x65\x73\x73\141\147\x65\72\x20" . $nvqq5->body->message . "\xa\40\40\40\40\40\x20\40\40\40\x20\40\x20\x63\157\x64\x65\x3a\40" . $nvqq5->body->code . "\xa\150\x74\164\x70\x20\163\x74\141\164\x75\x73\40\x63\x6f\x64\145\72\40" . $nvqq5->body->data->status; if (!$vtTNz) { goto H8bcx; } $TEwTs = $TEwTs . "\xa\x20\x72\x65\x73\160\x6f\x6e\x73\x65\x3a\40" . print_r($nvqq5, true); H8bcx: throw new Exception($TEwTs); } }
Function Calls
None |
Stats
MD5 | 5c3d7aab693c4167da6d6b73f205dab6 |
Eval Count | 0 |
Decode Time | 154 ms |