drupalway/nova-poshta-guzzle

Service integration API for the commerce_shipping module.

2.x-dev 2015-05-02 23:44 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:01:15 UTC


README

Build Status

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