Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
trash
/
vhost_www.arlenshop.fr_1556185825
/
htdocs
/
modules
/
envoimoinscher
/
Env
/
/srv/data/trash/vhost_www.arlenshop.fr_1556185825/htdocs/modules/envoimoinscher/Env/OrderStatus.php
<?php /** * 2007-2015 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author EnvoiMoinsCher <informationapi@boxtale.com> * @copyright 2007-2015 PrestaShop SA / 2011-2015 EnvoiMoinsCher * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registred Trademark & Property of PrestaShop SA */ class Env_OrderStatus extends Env_WebService { /** * Contains order informations. * <samp> * Structure :<br> * $order_info => array(<br> * ['emcRef'] => data<br> * ['state'] => data<br> * ['opeRef'] => data<br> * ['labelAvailable'] => data<br> * ['labelUrl'] => data<br> * ['labels'][x] => data<br> * ) * </samp> * @access public * @var array */ public $order_info = array('emcRef' => '', 'state' => '', 'opeRef' => '', 'labelAvailable' => false); /** * Function loads all categories. * @param $reference : folder reference * @access public * @return Void */ public function getOrderInformations($reference) { $this->setOptions(array('action' => '/api/v1/order_status/'.$reference.'/informations')); $this->doStatusRequest(); } /** * Function executes order request and prepares the $order_info array. * @access private * @return Void */ private function doStatusRequest() { $source = parent::doRequest(); /* We make sure there is an XML answer and try to parse it */ if ($source !== false) { parent::parseResponse($source); if (count($this->resp_errors_list) == 0) { /* The XML file is loaded, we now gather the datas */ $labels = array(); $order_labels = $this->xpath->evaluate('/order/labels/*'); foreach ($order_labels as $label_index => $label) $labels[$label_index] = $label->nodeValue; $documents = array(); $order_documents = $this->xpath->evaluate('/order/documents/*'); foreach ($order_documents as $docs) $documents[$docs->nodeName] = $docs->nodeValue; $this->order_info = array( 'emcRef' => $this->xpath->evaluate('/order/emc_reference')->item(0)->nodeValue, 'state' => $this->xpath->evaluate('/order/state')->item(0)->nodeValue, 'opeRef' => $this->xpath->evaluate('/order/carrier_reference')->item(0)->nodeValue, 'labelAvailable' => (bool)$this->xpath->evaluate('/order/label_available')->item(0)->nodeValue, 'labelUrl' => $this->xpath->evaluate('/order/label_url')->item(0)->nodeValue, 'labels' => $labels, 'documents' => $documents); } } } } ?>