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 declare (strict_types=1); namespace OneTeamSoftware\ShippingCarrier\EasyPost\EndPo..
Decoded Output download
<?php
declare (strict_types=1); namespace OneTeamSoftware\ShippingCarrier\EasyPost\EndPoint; use OneTeamSoftware\Cache\CacheInterface; use OneTeamSoftware\Cache\KeyGeneratorInterface; use OneTeamSoftware\Logger\LoggerInterface; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\AbstractEndPoint; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\ShipmentId\StringBuilder; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\TypesInterface; use OneTeamSoftware\ShippingCarrier\EasyPost\ShipmentId\Parts; use OneTeamSoftware\ShippingCarrier\EasyPost\Type\ServiceIdBuilder; use OneTeamSoftware\ShippingCarrier\EasyPost\Type\ShipmentPayload; class CreateShipment extends AbstractEndPoint { private $getRatesEndPoint; private $shipmentPayload; public function __construct(string $P9z8R, TypesInterface $xFZR6, LoggerInterface $j8tRa, CacheInterface $ZUcN0, KeyGeneratorInterface $Dfv4W, Payload $zhUqj) { parent::__construct($P9z8R, $xFZR6, $j8tRa, $ZUcN0, $Dfv4W, $zhUqj); $this->getRatesEndPoint = new GetRates($P9z8R, $xFZR6, $j8tRa, $ZUcN0, $Dfv4W, $zhUqj); $this->shipmentPayload = new ShipmentPayload($j8tRa, $zhUqj); } public function canUse() : bool { $SU3YQ = true; if ($SU3YQ && false === empty($this->shipmentPayload->getStatus())) { $SU3YQ = false; } if ($SU3YQ && empty($this->shipmentPayload->getService())) { $SU3YQ = false; } return $SU3YQ; } public function getMethod() : string { return "POST"; } public function getRoute() : string { return $this->getRatesEndPoint->getRoute(); } public function getPostData() : array { return $this->getRatesEndPoint->getPostData(); } public function getResponse(array $nQ0gI) : array { $this->logger->debug(__FILE__, 122, "getResponse: %s", print_r($nQ0gI, true)); $xUuMH = $this->getRatesEndPoint->getResponse($nQ0gI); if (empty($xUuMH["shipment"])) { return $xUuMH; } $J7zSn =& $xUuMH["shipment"]; $this->addShipmentIdPartsTo($J7zSn, $nQ0gI); $this->addServiceTo($J7zSn, $nQ0gI); $this->logger->debug(__FILE__, 134, "New Response: %s", print_r($xUuMH, true)); return $xUuMH; } private function addServiceTo(array &$J7zSn, array $nQ0gI) : void { $mo5QX = $this->shipmentPayload->getService(); if (empty($mo5QX) && false === empty($nQ0gI["selected_rate"])) { $G9qXm = $nQ0gI["selected_rate"]; $mo5QX = (new ServiceIdBuilder())->build($G9qXm); } $J7zSn["service"] = $mo5QX; } private function addShipmentIdPartsTo(array &$J7zSn, array $nQ0gI) : void { $this->logger->debug(__FILE__, 166, "addShipmentIdPartsTo"); $lhV9l = []; $lhV9l["shipment_id"] = $nQ0gI["id"]; if (false === empty($nQ0gI["rates"])) { $this->logger->debug(__FILE__, 172, "We have rates, so look for rate_id and carrier_id"); foreach ($nQ0gI["rates"] as $G9qXm) { $dG2Ka = $this->getShipmentIdPartsFromRate($G9qXm); if (false === empty($dG2Ka)) { $lhV9l += $dG2Ka; goto pSTJu; } BdWdM: } pSTJu: } if ($this->shipmentPayload->isReturn()) { if (false === empty($nQ0gI["to_address"]["id"])) { $lhV9l["from_address_id"] = $nQ0gI["to_address"]["id"]; } $lhV9l["return"] = true; } elseif (false === empty($nQ0gI["from_address"]["id"])) { $lhV9l["from_address_id"] = $nQ0gI["from_address"]["id"]; } $rIZas = $this->shipmentPayload->getInsuranceValue(); if ($rIZas > 0) { $lhV9l["insurance"] = $rIZas; } $this->logger->debug(__FILE__, 199, "Shipment ID parts: %s", print_r($lhV9l, true)); $J7zSn["id"] = (new StringBuilder(new Parts()))->build($lhV9l); $J7zSn = array_merge($J7zSn, $lhV9l); } private function getShipmentIdPartsFromRate(array $G9qXm) : array { $l7xu3 = (new ServiceIdBuilder())->build($G9qXm); $YlHXl = $this->shipmentPayload->getShipmentId()->getRateId(); if ($this->shipmentPayload->getService() !== $l7xu3 && $YlHXl !== ($G9qXm["id"] ?? '')) { return []; } $this->logger->debug(__FILE__, 219, "Found rate by service"); $lhV9l = []; $lhV9l["rate_id"] = $G9qXm["id"]; $lhV9l["carrier_id"] = $G9qXm["carrier_account_id"]; $lhV9l["carrier"] = $G9qXm["carrier"]; return $lhV9l; } }
?>
Did this file decode correctly?
Original Code
<?php
declare (strict_types=1); namespace OneTeamSoftware\ShippingCarrier\EasyPost\EndPoint; use OneTeamSoftware\Cache\CacheInterface; use OneTeamSoftware\Cache\KeyGeneratorInterface; use OneTeamSoftware\Logger\LoggerInterface; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\AbstractEndPoint; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\ShipmentId\StringBuilder; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload; use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\TypesInterface; use OneTeamSoftware\ShippingCarrier\EasyPost\ShipmentId\Parts; use OneTeamSoftware\ShippingCarrier\EasyPost\Type\ServiceIdBuilder; use OneTeamSoftware\ShippingCarrier\EasyPost\Type\ShipmentPayload; class CreateShipment extends AbstractEndPoint { private $getRatesEndPoint; private $shipmentPayload; public function __construct(string $P9z8R, TypesInterface $xFZR6, LoggerInterface $j8tRa, CacheInterface $ZUcN0, KeyGeneratorInterface $Dfv4W, Payload $zhUqj) { parent::__construct($P9z8R, $xFZR6, $j8tRa, $ZUcN0, $Dfv4W, $zhUqj); $this->getRatesEndPoint = new GetRates($P9z8R, $xFZR6, $j8tRa, $ZUcN0, $Dfv4W, $zhUqj); $this->shipmentPayload = new ShipmentPayload($j8tRa, $zhUqj); } public function canUse() : bool { $SU3YQ = true; if ($SU3YQ && false === empty($this->shipmentPayload->getStatus())) { $SU3YQ = false; } if ($SU3YQ && empty($this->shipmentPayload->getService())) { $SU3YQ = false; } return $SU3YQ; } public function getMethod() : string { return "\x50\x4f\123\124"; } public function getRoute() : string { return $this->getRatesEndPoint->getRoute(); } public function getPostData() : array { return $this->getRatesEndPoint->getPostData(); } public function getResponse(array $nQ0gI) : array { $this->logger->debug(__FILE__, 122, "\x67\145\164\122\145\x73\160\157\x6e\163\x65\x3a\40\x25\x73", print_r($nQ0gI, true)); $xUuMH = $this->getRatesEndPoint->getResponse($nQ0gI); if (empty($xUuMH["\163\150\151\160\x6d\145\156\x74"])) { return $xUuMH; } $J7zSn =& $xUuMH["\163\x68\151\160\155\x65\156\164"]; $this->addShipmentIdPartsTo($J7zSn, $nQ0gI); $this->addServiceTo($J7zSn, $nQ0gI); $this->logger->debug(__FILE__, 134, "\116\x65\167\40\122\x65\163\160\x6f\156\x73\145\x3a\x20\x25\163", print_r($xUuMH, true)); return $xUuMH; } private function addServiceTo(array &$J7zSn, array $nQ0gI) : void { $mo5QX = $this->shipmentPayload->getService(); if (empty($mo5QX) && false === empty($nQ0gI["\163\x65\154\x65\x63\164\x65\x64\137\x72\141\x74\x65"])) { $G9qXm = $nQ0gI["\x73\x65\154\x65\x63\164\x65\x64\x5f\x72\141\164\145"]; $mo5QX = (new ServiceIdBuilder())->build($G9qXm); } $J7zSn["\x73\145\162\166\151\x63\145"] = $mo5QX; } private function addShipmentIdPartsTo(array &$J7zSn, array $nQ0gI) : void { $this->logger->debug(__FILE__, 166, "\141\144\144\123\150\151\160\155\145\156\164\111\144\120\141\x72\164\x73\124\157"); $lhV9l = []; $lhV9l["\x73\150\151\160\155\x65\x6e\164\x5f\151\144"] = $nQ0gI["\151\x64"]; if (false === empty($nQ0gI["\162\x61\164\x65\163"])) { $this->logger->debug(__FILE__, 172, "\127\x65\40\x68\x61\166\x65\x20\x72\x61\x74\145\x73\x2c\40\163\157\40\154\157\157\x6b\40\146\x6f\x72\40\x72\141\x74\x65\x5f\x69\x64\x20\141\x6e\144\x20\x63\x61\162\x72\x69\145\162\x5f\151\144"); foreach ($nQ0gI["\x72\x61\164\x65\x73"] as $G9qXm) { $dG2Ka = $this->getShipmentIdPartsFromRate($G9qXm); if (false === empty($dG2Ka)) { $lhV9l += $dG2Ka; goto pSTJu; } BdWdM: } pSTJu: } if ($this->shipmentPayload->isReturn()) { if (false === empty($nQ0gI["\164\x6f\x5f\x61\144\x64\x72\145\x73\163"]["\x69\144"])) { $lhV9l["\x66\x72\x6f\155\137\x61\144\x64\162\x65\163\163\x5f\151\x64"] = $nQ0gI["\x74\157\x5f\141\144\144\162\145\163\163"]["\x69\144"]; } $lhV9l["\162\145\164\x75\x72\156"] = true; } elseif (false === empty($nQ0gI["\146\162\157\x6d\137\x61\x64\x64\x72\145\x73\163"]["\151\144"])) { $lhV9l["\146\x72\157\x6d\x5f\x61\x64\x64\162\x65\x73\x73\x5f\151\x64"] = $nQ0gI["\x66\162\x6f\155\x5f\x61\144\144\x72\x65\x73\x73"]["\151\144"]; } $rIZas = $this->shipmentPayload->getInsuranceValue(); if ($rIZas > 0) { $lhV9l["\151\x6e\163\165\x72\x61\156\143\x65"] = $rIZas; } $this->logger->debug(__FILE__, 199, "\123\x68\151\x70\x6d\x65\156\x74\x20\111\x44\x20\x70\141\x72\x74\x73\x3a\x20\x25\x73", print_r($lhV9l, true)); $J7zSn["\x69\144"] = (new StringBuilder(new Parts()))->build($lhV9l); $J7zSn = array_merge($J7zSn, $lhV9l); } private function getShipmentIdPartsFromRate(array $G9qXm) : array { $l7xu3 = (new ServiceIdBuilder())->build($G9qXm); $YlHXl = $this->shipmentPayload->getShipmentId()->getRateId(); if ($this->shipmentPayload->getService() !== $l7xu3 && $YlHXl !== ($G9qXm["\151\144"] ?? '')) { return []; } $this->logger->debug(__FILE__, 219, "\106\157\x75\156\144\x20\x72\141\x74\145\40\x62\x79\40\x73\x65\x72\x76\x69\143\145"); $lhV9l = []; $lhV9l["\162\141\164\x65\x5f\151\144"] = $G9qXm["\x69\x64"]; $lhV9l["\143\x61\x72\x72\x69\145\162\x5f\x69\x64"] = $G9qXm["\143\141\x72\x72\151\145\162\137\141\143\143\157\165\156\x74\x5f\x69\x64"]; $lhV9l["\x63\141\162\162\x69\x65\162"] = $G9qXm["\143\x61\162\162\151\145\162"]; return $lhV9l; } }
Function Calls
None |
Stats
MD5 | fa2e697321b8be2310cc70f34652d852 |
Eval Count | 0 |
Decode Time | 100 ms |