Laravel package for connecting to DPD Shipper API.
This package requires Laravel 10.x and PHP 8.1 (or higher).
We are a young and driven team of technicians with a mission. We ensure that our clients' online challenges are solved with manageable and sustainable tools. We connect existing and reliable solutions to each other. This allows us to create customized solutions, often in combination with professional (open-source) packages and APIs. We ensure that all online solutions always perform at the highest level. In addition, we provide professional support without hassle through our service portal.
composer require flooris/dpd-shipper-laravel
php artisan vendor:publish --tag=dpd-shipper-config
nano config/dpd-shipper.php
// Borsigstraße 20-22, 44145 Dortmund, Duitsland
// https://goo.gl/maps/FoKHQ4DwEEiY9ift5
$countryIso = 'DE';
$postalCode = '44145';
$parcelCount = 1;
$email = '[email protected]';
$mobilePhone = '0612345678';
$shipmentProduct = new DpdShipmentProduct($countryIso, $postalCode);
$predict = $shipmentProduct->getPredict($countryIso, $email, $mobilePhone);
$parcels = new DpdParcels();
$parcels->setCustomerReferenceNumber1('TEST12345');
$parcels->setWeight(1);
$recipient = new DpdRecipient(
name1: 'John Doe',
street: 'Borsigstraße',
houseNumber: '20-22',
countryIso: 'DE',
postalCode: $postalCode,
city: 'Dortmund',
email: $email
);
try {
$shipmentLabel = $this->dpdShipperConnector->shipmentService()->createShipment(
shipmentProduct: $shipmentProduct,
parcelCount: $parcelCount,
parcels: $parcels,
sender: $this->dpdSender,
recipient: $recipient,
dpdPredict: $predict
);
$mpsId = $shipmentLabel->mpsId;
$barcodeCollection = $shipmentLabel->getBarcodes();
$pdfData = $shipmentLabel->fileData;
} catch (DpdShipmentResponseException $e) {
} catch (SoapFault $e) {
throw $e;
}
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.