2017 © Pedro Peláez
 

library laravel-dhl-tas

A basic API to easily generate the necessary requests for Trade Automation Service for Laravel

image

misterbrownrsa/laravel-dhl-tas

A basic API to easily generate the necessary requests for Trade Automation Service for Laravel

  • Sunday, December 3, 2017
  • by MisterBrownRSA
  • Repository
  • 0 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

Laravel DHL API

I needed a laravel-esque wrapper to make calls to the DHL XML service, but couldn't find any. So I created one. It was specifically designed for my own personal use, but you are welcome to submit issues, and I'll look into refactoring it so that it can be used in a more general purpose fashion., (*1)

Getting Started

Prerequisites

This was built and tested ONLY on Laravel 5.5, although I'm sure it'll work on previous versions as well., (*2)

Installing

composer require misterbrownrsa/laravel-dhl-tas

Since Laravel 5.5 automatically includes the service provider, it won't be necessary to register it. However, if you really want to, run the following command, (*3)


Usage Examples

Trade Automation Services provides duties and tax details when trying to calculate total landed cost for a shipment, (*4)

$products = [];
foreach ($cart->items as $cartItem) {
    $products[] = [
        'name'     => $cartItem->warehouse->product->name,
        'price'    => $cartItem->price,
        'quantity' => $cartItem->quantity,
        'weight'   => $cartItem->warehouse->product->weight,
        'hscode'   => "6404.1900", //retrieved from their HSCode systems
    ];
}

$TAS = new \MisterBrownRSA\DHL\TAS\DHLTAS();
$TAS->addProduct($products);
$TAS->total($cart->subtotal);
$TAS->reference('A1AQV');
$TAS->toCountry('ZW');
$results = $TAS->doCurlPost();

Dump the request, (*5)

dump($TAS->toXMML());

Dump the response, (*6)

dump($TAS->doCurlPost());

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details, (*7)

Acknowledgments

  • Thanks David for your help during the implementation process

The Versions

03/12 2017

dev-master

9999999-dev

A basic API to easily generate the necessary requests for Trade Automation Service for Laravel

  Sources   Download

MIT

The Requires

  • php >=7.0

 

by Duwayne Brown

03/12 2017

1.0.0

1.0.0.0

A basic API to easily generate the necessary requests for Trade Automation Service for Laravel

  Sources   Download

MIT

The Requires

  • php >=7.0

 

by Duwayne Brown