https://github.com/updevru/php-shop-logistics.ru-api
PHP oop wrapper for shop-logistics.ru remote functions
https://github.com/updevru/php-shop-logistics.ru-api
Last synced: 6 months ago
JSON representation
PHP oop wrapper for shop-logistics.ru remote functions
- Host: GitHub
- URL: https://github.com/updevru/php-shop-logistics.ru-api
- Owner: updevru
- License: mit
- Fork: true (gennadyx/php-shop-logistics.ru-api)
- Created: 2017-08-30T19:01:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-30T19:05:35.000Z (almost 9 years ago)
- Last Synced: 2025-07-24T09:26:13.208Z (12 months ago)
- Language: PHP
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# php-shop-logistics.ru-api
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Build Status][ico-travis]][link-travis]
[![Total Downloads][ico-downloads]][link-downloads]
[![Coverage Status][ico-coverage]][link-coverage]
[![Sensiolabs_Medal][ico-code-quality-sensio]][link-code-quality-sensio]
[![Quality Score][ico-code-quality-scrutinizer]][link-code-quality-scrutinizer]
##php-shop-logistics.ru-api
PHP oop wrapper for shop-logistics.ru remote functions
## Install
Via Composer
``` bash
$ composer require gennadyx/php-shop-logistics.ru-api
```
## Usage
``` php
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](CHANGELOG.md) for more information on what has changed recently.
## Testing
``` bash
$ composer test
```
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security
If you discover any security related issues, please email dev@gennadyx.tech instead of using the issue tracker.
## Credits
- [Gennady Knyazkin][link-author]
- [All Contributors][link-contributors]
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.
[ico-version]: https://img.shields.io/packagist/v/gennadyx/php-shop-logistics.ru-api.svg?style=flat
[ico-license]: https://img.shields.io/packagist/l/gennadyx/php-shop-logistics.ru-api.svg?style=flat
[ico-travis]: https://img.shields.io/travis/gennadyx/php-shop-logistics.ru-api/master.svg?style=flat
[ico-coverage]: https://img.shields.io/scrutinizer/coverage/g/gennadyx/php-shop-logistics.ru-api.svg?style=flat
[ico-code-quality-scrutinizer]: https://img.shields.io/scrutinizer/g/gennadyx/php-shop-logistics.ru-api.svg?style=flat
[ico-code-quality-sensio]: https://insight.sensiolabs.com/projects/6ede6306-c632-40ec-bffb-8e533a81ca55/mini.png
[ico-downloads]: https://img.shields.io/packagist/dt/gennadyx/php-shop-logistics.ru-api.svg?style=flat
[link-packagist]: https://packagist.org/packages/gennadyx/php-shop-logistics.ru-api
[link-travis]: https://travis-ci.org/gennadyx/php-shop-logistics.ru-api
[link-coverage]: https://scrutinizer-ci.com/g/gennadyx/php-shop-logistics.ru-api/code-structure
[link-code-quality-scrutinizer]: https://scrutinizer-ci.com/g/gennadyx/php-shop-logistics.ru-api
[link-code-quality-sensio]: https://insight.sensiolabs.com/projects/6ede6306-c632-40ec-bffb-8e533a81ca55
[link-downloads]: https://packagist.org/packages/gennadyx/php-shop-logistics.ru-api
[link-author]: http://gennadyx.tech
[link-contributors]: https://github.com/gennadyx/php-shop-logistics.ru-api/contributors