PHP code example of homer / kuaidi100

1. Go to this page and download the library: Download homer/kuaidi100 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

homer / kuaidi100 example snippets


use Homer\Logistics\Kuaidi100\Service as LogisticsService;

$service = new LogisticsService(<YOUR_COMPANY_NAME>, <KEY>);
// - or the full version
// $service = new LogisticsService(<YOUR_COMPANY_NAME>, <KEY>, $optionsOfService, $instanceOfClient);

// to start tracking waybill
$service->track(<waybill#>, $options);

// handle on waybill's status update
$service->handleWaybillUpdated($notification, Closure $callback);

// eagerly query logistics of some waybill
$logistics = $service->query(<CODE_OF_LOGISTICS_COMPANY>, <waybill#>, <FROM_LOCATION>, <TO_LOCATION>);