##php-shop-logistics.ru-api PHP oop wrapper for shop-logistics.ru remote functions
Via Composer
$ composer require gennadyx/php-shop-logistics.ru-api
use Gennadyx\ShopLogisticsRu\ApiClientBuilder;
use Gennadyx\ShopLogisticsRu\Environment;
use Gennadyx\ShopLogisticsRu\Api\Dictionary;
use Http\Message\MessageFactory\DiactorosMessageFactory;
use Http\Message\StreamFactory\DiactorosStreamFactory;
$client = ApiClientBuilder::create()
->withRequestFactory(new DiactorosMessageFactory())
->withStreamFactory(new DiactorosStreamFactory())
->withEncoder(function ($data) {
$xml = '';
//your logic here
return $xml;
})
->withEnvironment(Environment::PROD())
->withKey('your_key')
->build();
//or just build with default parameters
$client = ApiClientBuilder::create()->build();
/** @var Dictionary $dictionary */
$dictionary = $client->api('dictionary');
//call remote function
$cities = $dictionary->getCities();
//or
$states = $client->dictionary->getStates();//array
//if any error (http exception or other)
$metro = $client->dictionary->getMetro();
//$metro instance of \Gennadyx\ShopLogisticsRu\Response\Error with error code
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email dev@gennadyx.tech instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.