PHP code example of dansmaculotte / colissimo-php

1. Go to this page and download the library: Download dansmaculotte/colissimo-php 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/ */

    

dansmaculotte / colissimo-php example snippets


use DansMaCulotte\Colissimo\Colissimo;

try {
    $colissimo = new Colissimo();
    $colissimo->checkWebServiceStatus();
} catch (\Exception $e) {
    print_r($e);
}

use DansMaCulotte\Colissimo\DeliveryChoice;

$delivery = new DeliveryChoice(
    [
        'accountNumber' => COLISSIMO_LOGIN,
        'password' => COLISSIMO_PASSWORD,
    ]
);

$result = $delivery->findPickupPoints(
    'Caen',
    '14000',
    'FR',
    Carbon::now()->format('d/m/Y'),
    [
        'address' => '7 rue Mélingue',
    ]
);

print_r($result);

use DansMaCulotte\Colissimo\DeliveryChoice;

$delivery = new DeliveryChoice(
    [
        'accountNumber' => COLISSIMO_LOGIN,
        'password' => COLISSIMO_PASSWORD,
    ]
);

$result = $delivery->findPickupPointByID(
    '149390',
    Carbon::now()->format('d/m/Y')
);

print_r($result);

use DansMaCulotte\Colissimo\ParcelTracking;

$parcelTracking = new ParcelTracking(
    [
        'accountNumber' => COLISSIMO_LOGIN,
        'password' => COLISSIMO_PASSWORD,
    ]
);

$result = $parcelTracking->getStatusByID('111111111');

print_r($result);
 bash
composer