flooris/dpd-shipper-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flooris/dpd-shipper-laravel

最新稳定版本:0.0.4

Composer 安装命令:

composer require flooris/dpd-shipper-laravel

包简介

Laravel package for connecting to DPD Shipper API

README 文档

README

Laravel package for connecting to DPD Shipper API.

Requirements

This package requires Laravel 10.x and PHP 8.1 (or higher).

Flooris

Flooris visual

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.

Install the package via composer

composer require flooris/dpd-shipper-laravel

Publish the package config

php artisan vendor:publish --tag=dpd-shipper-config
nano config/dpd-shipper.php

Usage example

// Borsigstraße 20-22, 44145 Dortmund, Duitsland
// https://goo.gl/maps/FoKHQ4DwEEiY9ift5
$countryIso  = 'DE';
$postalCode  = '44145';
$parcelCount = 1;

$email       = 'test-dpd@flooris.nl';
$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;
}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-07