echo "Créneau end : " . $slot_end . "\n"; echo "ID transaction : " . $transaction_id . "\n"; echo $res_confirm->message . "\n"; echo "-------------------------------------------------------------"; echo "\n\n"; $product_code = $res_confirm->productService->productCode; $service_code = $res_confirm->productService->serviceCode; $customer = array('civility' => 'M', 'firstname' => 'John', 'lastname' => 'Doe', 'name' => 'John Doe', 'name2' => 'societe JD', 'address1' => '46 rue de douai', 'address2' => 'complement addr', 'zip_code' => 75009, 'city' => 'Paris', 'iso_code' => 'FR', 'country' => 'FRANCE', 'phone' => '0102030405'); $shipper = array('civility' => 'M', 'name' => 'Entreprise X', 'name2' => 'societe ent. X', 'address1' => '57 boulevard des batignolles', 'address2' => 'App 6', 'zip_code' => 75017, 'city' => 'Paris', 'iso_code' => 'FR', 'country' => 'FRANCE', 'phone' => '0102030406'); $skybill = array('evt_code' => 'DC', 'product_code' => $product_code, 'weight' => 1000 / 1000, 'service' => $service_code, 'object_type' => 'MAR'); $time_slot_date = new DateTime($date, new DateTimeZone('Europe/Paris')); $time_slot_start = new DateTime($date . ' ' . $slot_start . ':00:00', new DateTimeZone('Europe/Paris')); $time_slot_end = new DateTime($date . ' ' . $slot_end . ':00:00', new DateTimeZone('Europe/Paris')); $appointment = array('time_slot_tariff' => $tariff, 'time_slot_start' => $time_slot_start->format('Y-m-d\\TH:i:s.uZ'), 'time_slot_end' => $time_slot_end->format('Y-m-d\\TH:i:s.uZ')); $ref = array('recipient_ref' => '123456', 'shipper_ref' => '123456'); $res = ChronoDeliverySlot::shippingBooking($confirm, $customer, $shipper, $skybill, $ref, $appointment); $booking = $res['shipping']; echo "----------------3 : Réservation -----------------\n"; echo "Code : " . $booking->errorCode . "\n"; echo "Message : " . $booking->errorMessage . "\n"; echo "skybillNumber : " . $booking->skybillNumber . "\n"; echo "---------------------------------------------------"; echo "\n\n"; $etiquette = ChronoDeliverySlot::getEtiquette(array('reservation_number' => $booking->reservationNumber)); if (!$etiquette['result']) { die("Error " . $etiquette['error'] . "\n"); } echo "----------------4 : Récupération étiquette ------------\n"; echo "Url étiquette : " . $etiquette['url_etiquette'] . "\n"; echo "-------------------------------------------------------"; echo "\n\n";