mcs / myparcel
Basic interaction with the MyParcel Api
Installs: 2 588
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: >= 5.4
- ext-curl: *
This package is not auto-updated.
Last update: 2022-10-29 08:45:58 UTC
README
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); }