定制 sonnenglas/mydhl-php-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sonnenglas/mydhl-php-sdk

最新稳定版本:0.3.2

Composer 安装命令:

composer require sonnenglas/mydhl-php-sdk

包简介

Unofficial PHP SDK for MyDHL REST API (DHL Express)

README 文档

README

PHP library for using DHL Express REST API (MyDHL API).

Status: CircleCI

Note: It supports only the latest REST API provided by DHL. No SOAP API support.

Supported services:

Service Supported
RATING
Retrieve Rates for a one piece Shipment
Retrieve Rates for Multi-piece Shipments
Landed Cost
PRODUCT
Retrieve DHL Express products
SHIPMENT
Electronic Proof of Delivery
Upload updated customs docs for shipment
Create Shipment
Upload Commercial Invoice Data for shipment
TRACKING
Track a single DHL Express Shipment
Tracka single or multiple DHL Express Shipments
PICKUP
Cancel a DHL Express pickup booking request
Update pickup information for existing pickup booking req
Create a DHL Express pickup booking request
IDENTIFIER
Service to allocate identifiers upfront ...
ADDRESS
Validate DHL Express pickup/delivery capability
INVOICE
Upload Commercial Invoice data

Usage:

diff

Retrieve rates

use Sonnenglas\MyDHL\MyDHL;
use Sonnenglas\MyDHL\ValueObjects\RateAddress;
use Sonnenglas\MyDHL\ValueObjects\Package;

$testMode = true;
$myDhl = new MyDHL('username', 'password', $testMode);

$rateService = $myDhl->getRateService();

$originAddress = new RateAddress(
    countryCode: 'DE',
    postalCode: '10117',
    cityName: 'Berlin',
);

$destinationAddress = new RateAddress(
    countryCode: 'DE',
    postalCode: '20099',
    cityName: 'Hamburg',
);

$package = new Package(
    weight: 10, // kg
    height: 20, // cm
    length: 10, // cm
    width: 30, // cm
);

$shippingDate = new DateTimeImmutable('2021-01-15 12:00:00');

$rates = $rateService->setAccountNumber('99999999')
    ->setOriginAddress($originAddress)
    ->setDestinationAddress($destinationAddress)
    ->setPlannedShippingDate($shippingDate)
    ->setPackage($package)
    ->setNextBusinessDay(false)
    ->setCustomsDeclarable(false)
    ->getRates();

All usage examples:

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-14