2017 © Pedro Peláez
 

library dhl-api

DHL-API

image

ecommerce-utilities/dhl-api

DHL-API

  • Thursday, June 1, 2017
  • by ecommerce-utilities
  • Repository
  • 1 Watchers
  • 1 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 6 % Grown

The README.md

DHL-API

Use at your own risk - parents are responsible for their children!, (*1)

Latest Stable Version License, (*2)

Composer

composer require ecommerce-utilities/dhl-api *, (*3)

Example:

<?php
use EcommerceUtilities\DHL\Common\DHLApiCredentials;
use EcommerceUtilities\DHL\Common\DHLBusinessPortalCredentials;
use EcommerceUtilities\DHL\DHLServices;
use GuzzleHttp\Client;
use Http\Factory\Guzzle\RequestFactory;
use Http\Message\StreamFactory\GuzzleStreamFactory;

require 'vendor/autoload.php';

$businessCred = new DHLBusinessPortalCredentials('<appId from entwickler.dhl.de>', '<Token from entwickler.dhl.de>');
$cred = new DHLApiCredentials(true, '<username of www.dhl.de/de/geschaeftskunden>', '<password of www.dhl.de/de/geschaeftskunden>', '<receiver-id>');

$services = new DHLServices($businessCred, $cred, new RequestFactory(), new GuzzleStreamFactory(), new Client());
$response = $services->getRetoureService()->getRetourePdf(
    'Max',         // $name1
    'Mustermann',  // $name2
    null,          // $name3
    'Musterstr.',  // $street
    123,           // $streetNumber
    72770,         // $zip
    'Reutlingen',  // $city
    'DE',          // $countryId
    '123446-B',    // $voucherNr
    null           // $shipmentReference
);

printf("%s\n", $response->getTrackingNumber());
file_put_contents('label.pdf', $response->getLabelData());

The Versions

01/06 2017

dev-master

9999999-dev

DHL-API

  Sources   Download

MIT

01/06 2017

0.1

0.1.0.0

DHL-API

  Sources   Download

MIT