$start_hour = 10; $end_hour = 12; $service = new ChronoDeliverySlot(); $search = new searchDeliverySlot(); $search->accountNumber = $account; $search->password = $passwd; $search->shipperAdress1 = '82 Rue test'; $search->shipperAdress2 = 'complement addr'; $search->shipperZipCode = '75017'; $search->shipperCity = 'Paris'; $search->shipperCountry = 'FR'; $search->recipientCountry = 'FR'; $search->recipientZipCode = '75009'; $search->dateBegin = $now->format('Y-m-d\\TH:i:s.uZ'); $search->productType = 'RDV'; $res_search = $service->searchDeliverySlot($search)->return; if ($res_search->code != 0) { die("Error code " . $res_search->message . "\n"); } echo "\n"; echo "----------------1 : Recherche créneaux-----------------\n"; echo "Recherche créneau à partir du : " . $now->format('Y-m-d') . "\n"; echo "Date de livraison souhaité : " . $date_start->format('Y-m-d') . "\n"; echo $res_search->message . "\n"; echo "-------------------------------------------------------"; echo "\n\n"; $transaction_id = $res_search->transactionID; $mesh_code = $res_search->meshCode; $slots = $res_search->slotList; if (!is_array($slots) && count($slots) === 0) { die("Pas de créneaux disponible.\n");
<?php require_once dirname(__FILE__) . '/../src/Antilop/ChronoApi/ChronoDeliverySlot.php'; require_once dirname(__FILE__) . '/../src/Antilop/ChronoApi/ShippingServiceWSService.php'; require_once dirname(__FILE__) . '/../src/Antilop/ChronoApi/Request/searchDeliverySlot.php'; use Antilop\ChronoApi\ChronoDeliverySlot; use Antilop\ChronoApi\Request\searchDeliverySlot; $account = $argv[1]; $passwd = $argv[2]; if (empty($account) || empty($passwd)) { var_dump('Paramètres de connexion'); } $now = new DateTime('now', new DateTimeZone('Europe/Paris')); $date_start = clone $now; $date_start->modify('+1 day'); $service = new ChronoDeliverySlot(); $params = new searchDeliverySlot(); $params->accountNumber = $account; $params->password = $passwd; $params->shipperAdress1 = '82 Rue test'; $params->shipperAdress2 = ''; $params->shipperZipCode = '75017'; $params->shipperCity = 'Paris'; $params->shipperCountry = 'FR'; $params->recipientCountry = 'FR'; $params->recipientZipCode = '75009'; $params->dateBegin = $date_start->format('Y-m-d\\TH:i:s.uZ'); $params->productType = 'RDV'; $res = $service->searchDeliverySlot($params)->return; echo $res->message;