Download the PHP package kskby/dpd without Composer

On this page you can find all versions of the php package kskby/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 dpd

Client SDK DPD

SDK для интеграции с API доставки DPD.

Требования

Установка

Через Composer

Из исходников

Клонируйте репозиторий и подключите автозагрузку:

Затем установите зависимости:

После установки

Для расчёта стоимости нужен импорт городов и терминалов во внутреннюю БД. Примеры загрузчиков: examples/load_locations.php, examples/load_terminals.php.

Настройки

Параметры передаются в \Ipol\DPD\Config\Config (или в класс, реализующий \Ipol\DPD\Config\ConfigInterface):

Пример для Беларуси:

Расчёт стоимости доставки

Сначала создаётся отправка \Ipol\DPD\Shipment:

Расчёт выполняет \Ipol\DPD\Calculator:

В calculate и calculateWithTariff можно передать код валюты. Для конвертации нужен класс с интерфейсом \Ipol\DPD\Currency\ConverterInterface:

Отправка заказа

Заказ хранится в модели \Ipol\DPD\DB\Order\Model и во внутренней БД:

Операции с API DPD — через $order->dpd() (\Ipol\DPD\Order):

Работа с местоположениями и терминалами

После загрузки данных города и ПВЗ доступны через DataMapper:

Возвращается объект с интерфейсом \Ipol\DPD\DB\TableInterface. У локаций есть getByAddress($country, $region, $city, $select = '*').

Cron

Класс \Ipol\DPD\Agents содержит методы для периодических заданий, в том числе обновление статусов заказов:

Тесты

Автотесты на PHPUnit 11 покрывают основные сценарии (маршрут Гомель → Минск, БД SQLite in-memory, моки API).

Установка dev-зависимостей и запуск:

Эквивалентно:

Конфигурация: phpunit.xml.dist, тесты в каталоге tests/.

Кодировка

Модуль работает в UTF-8. Для другой кодировки проекта конвертируйте данные самостоятельно. Вспомогательный метод:

Примеры

В каталоге examples/ — примеры использования SDK.

Документация

Описание классов и методов: документация.


All versions of dpd with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
symfony/cache Version ^4.1
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 kskby/dpd contains the following files

Loading the files please wait ...