bear926 / nova-poshta-guzzle
Service integration API for the commerce_shipping module.
2.1.x-dev
2019-08-12 18:56 UTC
Requires
- php: >=5.4
- guzzlehttp/guzzle-services: ^1.1
README
A PHP implementation of the Nova Poshta API via Guzzle.
This project currently implements the Cities & Warehouses List.
Usage
You will need an API Key to run the examples. You can get them from Nova Poshta user cabinet https://my.novaposhta.ua/settings/index#apikeys. Note: you should be registered to do so.
use Drupalway\NovaPoshta\NovaPoshtaClient; $api = NovaPoshtaClient::factory([ 'defaults' => [ 'api_key' => YOUR_API_KEY, ] ]);
Get cities list (partial search by title)
use Drupalway\NovaPoshta\NovaPoshtaClient; $api = NovaPoshtaClient::factory([ 'defaults' => [ 'api_key' => YOUR_API_KEY, ] ]); $cities = $api->getCities(); $cities = $api->getCities([ 'filters' => [ 'search_text' => 'Ки', ]]);
Requirements
- PHP 5.4
- php5-curl (suggested, unless you want to use a custom adapter)
Credits
Guzzle does most of the heavy lifting. This project is really just an elaborate Guzzle Services config.
License
MIT