mcs/myparcel

This package is abandoned and no longer maintained. No replacement package was suggested.

Basic interaction with the MyParcel Api

0.0.2 2016-06-05 12:12 UTC

This package is not auto-updated.

Last update: 2022-10-29 08:45:58 UTC


README

Latest Stable Version Latest Unstable Version License

Installation:

$ composer require mcs/myparcel

Submit a shipment to the MyParcel webservice and retrieve it's label and tracking information

require_once 'vendor/autoload.php';

$shipment = new MCS\MyParcelShipment(
    '<username>',
    '<apiKey>'
);

$shipment->setReference('Reference 1');

$shipment->setAddress([
    'country_code' => '',
    'name' => '',
    'business' => '',
    'postcode' => '',
    'house_number' => '',
    'number_addition' => '',
    'street' => '',
    'town' => '',
    'email' => '',
    'phone_number' => '',
]);

if($shipment->ship()){
    $response = $shipment->getLabel();    
    print_r($response);
}