updevru / php-shop-logistics.ru-api
php-shop-logistics.ru-api composer package
0.1.1
2017-03-06 10:05 UTC
Requires
- php: ~5.6|~7.0
- myclabs/php-enum: ^1.5
- php-http/httplug: ^1.1
- php-http/message-factory: ^1.0
Requires (Dev)
- php-http/client-common: ^1.4
- php-http/curl-client: ^1.6
- php-http/mock-client: ^0.3
- phpunit/phpunit: ~5.7
- squizlabs/php_codesniffer: ^2.3
- symfony/serializer: ^3.2
- zendframework/zend-diactoros: ^1.3
Suggests
- symfony/serializer: For using xml encoder/decoder from serializer component
This package is auto-updated.
Last update: 2024-10-29 05:22:23 UTC
README
##php-shop-logistics.ru-api PHP oop wrapper for shop-logistics.ru remote functions
Install
Via Composer
$ composer require gennadyx/php-shop-logistics.ru-api
Usage
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
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email dev@gennadyx.tech instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.