Giter VIP home page Giter VIP logo

laravel-dhlparcel's Introduction

DHL Parcel API client for Laravel

Latest Version on Packagist Software License Tests StyleCI Total Downloads

This package incorporates the DHL Parcel API client into your Laravel project.

Installation

You can install the package via composer:

composer require mvdnbrk/laravel-dhlparcel

Configuration

All you need to do is add your credentials to the .env file:

DHLPARCEL_ID=YOUR-USER-ID
DHLPARCEL_SECRET=YOUR-SECRET-KEY

Usage

use Mvdnbrk\Laravel\Facades\DhlParcel;

$shipment = DhlParcel::shipments()->create([
   ...
]);

Global helper method

For your convenience this package provides a global dhlparcel() helper function.

dhlparcel()->shipments()->create([
   ...
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

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

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-dhlparcel's People

Contributors

mvdnbrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-dhlparcel's Issues

Cannot find DHLPARCEL_ID

where do I find DHLPARCEL_ID e.g (USER-ID)?
I can find DHLPARCEL_SECRET e.g(API Key) and API Secret but can't find DHLPARCEL_ID e.g (USER-ID)

Support for Shipment option PERS_NOTE

We would like to add a personal note to the Track & trace email to our customers. DHL provides the option PERS_NOTE when creating a new Shipment. But there is no way to enter it in this API client.

The supplied body could not be parsed correctly, see the details field for additional information.

Describe the bug
While trying to create shipment it fails and show 500 error
request post->

$parcel = new \Mvdnbrk\DhlParcel\Resources\Parcel([
            'reference' => $order->code,
            'recipient' => [
                'first_name' =>  $firstname,
                'last_name' =>  $lastname,
                'street' => $order['shipping_address']['address'],
                'number' => '',
                'number_suffix' => '',
                'postal_code' => $order['shipping_address']['postal_code'],
                'city' => $order['shipping_address']['city'],
                'cc' => 'DE',
            ],
            'sender' => [
                'company_name' => env('DHLPARCEL_COMPANY_NAME'),
                'street' => env('DHLPARCEL_STREET', "Bredowstr 17 "),
                'additional_address_line' => env('DHLPARCEL_ADDITIONAL_ADDRESS_LINE'),
                'number' => env('DHLPARCEL_NUMBER'),
                'postal_code' => env('DHLPARCEL_POSTAL_CODE', "22113"),
                'city' => env('DHLPARCEL_CITY', "Hamburg"),
                'cc' => env('DHLPARCEL_COUNTRY', "DE"),
            ]
        ]);

$shipment = DhlParcel::shipments()->create($parcel);

request response->

Mvdnbrk\DhlParcel\Exceptions\DhlParcelException
Error executing API call: The supplied body could not be parsed correctly, see the details field for additional information.

To Reproduce
Body field is missing or incorrectly passing

Expected behavior
It should return shipment id and label_id from response

Please complete the following information:

  • Package version: "mvdnbrk/laravel-dhlparcel": "^1.4",
  • Laravel Version: "laravel/framework": "^v8.83.2",
  • PHP Version: 7.4.18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.