2017 © Pedro Peláez
 

library pakkelabels

PHP-SDK to communicate with Pakkelabels.dk

image

discimport/pakkelabels

PHP-SDK to communicate with Pakkelabels.dk

  • Monday, July 24, 2017
  • by lsolesen
  • Repository
  • 2 Watchers
  • 1 Stars
  • 96 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

Pakkelabels.dk PHP SDK

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version Total Downloads License, (*1)

PHP SDK for Pakkelabels.dk API from the Danish shipping service Pakkelabels.dk., (*2)

This is a modified version of the officially supported version on Pakkelabels.dk API. This version has composer integration, tests, following PSR2 coding standards and better error handling., (*3)

Getting started

Below is a simple PHP script which illustrate the minimum amount of code needed to getting started., (*4)

getMessage();
    }
?>

Once the $label object is created, you can begin to use the API., (*5)

To see the current balance:, (*6)

<?php
    echo $label->balance();
?>

To list all Post Danmark shipments sent to to Denmark:, (*7)

<?php
    $labels = $label->shipments(array('shipping_agent' => 'pdk', 'receiver_country' => 'DK'));
    print_r($labels);
?>

To display the PDF for the shipment ID with 42 inline in the browser:, (*8)

<?php
    $base64 = $label->pdf(42);
    $pdf = base64_decode($base64);
    header('Content-type: application/pdf');
    header('Content-Disposition: inline; filename="label.pdf"');
    echo $pdf;
?>

To create a test shipment with Post Danmark, and then output the Track&Trace number of the newly created shipment:, (*9)

 'pdk',
      'weight' => '1000',
      'receiver_name' => 'John Doe',
      'receiver_address1' => 'Some Street 42',
      'receiver_zipcode' => '5230',
      'receiver_city' => 'Odense M',
      'receiver_country' => 'DK',
      'sender_name' => 'John Wayne',
      'sender_address1' => 'The Batcave 1',
      'sender_zipcode' => '5000',
      'sender_city' => 'Odense C',
      'sender_country' => 'DK',
      'delivery' => 'true',
      'test' => 'true' // Change to false when going live
    );

    $shipment = $label->createShipment($data);
    echo 'Track&Trace: ' . $shipment['pkg_no'];
?>

Official library

You can find the official library at Github, (*10)

The Versions

24/07 2017

dev-master

9999999-dev http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

MIT

The Requires

  • php >=5.2.2

 

The Development Requires

23/07 2017

1.1.1

1.1.1.0 http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

MIT

The Requires

  • php >=5.2.2

 

The Development Requires

23/03 2016

1.1.0

1.1.0.0 http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

MIT

The Requires

  • php >=5.2.2

 

The Development Requires

22/03 2016

1.0.1

1.0.1.0 http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

MIT

The Requires

  • php >=5.2.2

 

The Development Requires

19/03 2016

dev-refatoring

dev-refatoring http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

MIT

The Requires

  • php >=5.2.2

 

The Development Requires

19/03 2016

dev-proper-filenames

dev-proper-filenames http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

MIT

The Requires

  • php >=5.2.2

 

The Development Requires

14/03 2016

dev-more-php-versions

dev-more-php-versions http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

The Requires

  • php >=5.2.2

 

The Development Requires

08/09 2015

1.0.0

1.0.0.0 http://github.com/discimport/pakkelabels-dk

PHP-SDK to communicate with Pakkelabels.dk

  Sources   Download

The Requires

  • php >=5.2.2

 

The Development Requires