Download the PHP package sergeevpasha/laravel-dpd without Composer

On this page you can find all versions of the php package sergeevpasha/laravel-dpd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-dpd

Maintainability Test Coverage CodeFactor Generic badge Generic badge

IMPORTANT UPDATE

DPD made lots of changes, so the best way I see it is having DPD API as a service, so starting from now on this package will have only a few basic functionality required for it, consider using it (will be available later) instead.

Laravel DPD API Wrapper

Allows you to:

Pre-requirements

You need to get DPD API key, user, login and password. Key can be obtained in your cabinet at https://www.dpd.ru/ols/order/personal/integrationKey.do2

Installation

composer require sergeevpasha/laravel-dpd

Configuration

This package has a few configuration values:

'key'        => env('DPD_KEY'),
'user'       => env('DPD_USER'),
'login'      => env('DPD_LOGIN'),
'password'   => env('DPD_PASSWORD'),
'prefix'     => 'dpd',
'middleware' => ['web']
php artisan vendor:publish --provider="SergeevPasha\DPD\Providers\DPDServiceProvider" --tag="config"

After installing, you may just import the client

use SergeevPasha\DPD\Libraries\DPDClient;
/* 
    You may find your User ID by entering DPD Cabinet.
    Here we are initializing the client.
*/
$client = new DPDClient('user', 'key');

Now we can use these methods:

$client->getCountryCities(string $country)
$client->getTerminals()
$client->findByTrackNumber(string $trackNumber)  
/* This one requires a Delivery Object, see next to see how to build it */
$client->getPrice(Delivery $delivery)

Delivery Object

To build a Delivery object you will need to pass an array to fromArray() method just like that:

Delivery::fromArray([
    arrival_city_id     => 123456, // Arrival City ID from findCity() method
    derival_city_id     => 123456, // Derival City ID from findCity() method
    arrival_terminal    => 1, // Set 1 if you are delivering to terminal
    derival_terminal    => 0, // Set 1 if you send from terminal
    parcel_total_weight => 20, // Total parcel weight, KG
    parcel_total_volume => 0.5, // Total parcel volume, M3
    parcel_total_value  => 1000500.50, // Total parcel volume, RUB
    pickup_date         => 2020-10-10, // YYYY-MM-DD Format, when your parcel should be picked up for delivery
    max_delivery_days   => 15, // Show only options that can be delivered for that or less amount of days
    max_delivery_price  => 1000.10, // Show only options that costs that or less price
    services => [
        'ECU',
        'CUR'
    ], // List of available services
])

Available countries

If you need to specify a country you need to use one of these codes:

RU - Russia
KZ - Kazakhstan
AM - Armenia
BY - Belarus
KG - Kyrgyzstan

Available services

If you need to specify a service you need to use one of these codes:

BZP = '18:00';
ECN - ECONOMY
ECU - ECONOMY CU
CUR - CLASSIC
NDY - EXPRESS
CSM - Online Express
PCL - OPTIMUM
PUP - SHOP
DPI - CLASSIC international IMPORT
DPE - CLASSIC international EXPORT
MAX - MAX domestic
MXO - Online Max

All versions of laravel-dpd with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^8.40.0 || ^9.0.0 || ^10.0.0
guzzlehttp/guzzle Version ^7.0
bensampo/laravel-enum Version >=3.0 <=6.0
spatie/data-transfer-object Version ^3.7
ext-soap Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sergeevpasha/laravel-dpd contains the following files

Loading the files please wait ....