2017 © Pedro PelĆ”ez
 

library ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

image

h4kuna/ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

  • Wednesday, April 11, 2018
  • by h4kuna
  • Repository
  • 7 Watchers
  • 21 Stars
  • 60,420 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 17 Versions
  • 9 % Grown

The README.md

Downloads this Month Latest Stable Version Coverage Status Total Downloads License, (*1)

More information about versions is in changelog., (*2)

Support development by QR code

Use QR code or sponsor button where is link on my revolut., (*3)

Thank you :), (*4)

QR payment, (*5)

Installation to project

The best way to install h4kuna/ares is using Composer:, (*6)

composer require h4kuna/ares

# optional and default support
composer require guzzlehttp/guzzle

Download information about customer via his IN., (*7)

ARES

Homepage documentation for developers., (*8)

Load data by one identification number., (*9)

use h4kuna\Ares;
$ares = (new Ares\AresFactory())->create();
try {
    $response = $ares->loadBasic('87744473');
    /* @var $response Ares\Ares\Core\Data */
    var_dump($response);
} catch (Ares\Exceptions\IdentificationNumberNotFoundException $e) {
    // log identification number, why is bad? Or make nothing.
} catch (Ares\Exceptions\AdisResponseException $e) {
    // if validation by adis failed, but data from ares returned
    /* @var $response Ares\Ares\Core\Data */
    $response = $e->data;
    $response->adis === null; // true
    var_dump($e->getMessage());
} catch (Ares\Exceptions\ServerResponseException $e) {
    // no response from server or broken json
}

Load data by many identification numbers. Limit by ARES service is set to 100 items, but library chunk it and check duplicity., (*10)

use h4kuna\Ares;
/** @var Ares\Ares $ares */
$numbers = ['one' => '25596641', 'two' => '26713250', 'three' => '27082440', 'four' => '11111111'];

try { 
    foreach ($ares->loadBasicMulti($numbers) as $name => $r) {
        var_dump($name, $r->company);
    }
} catch (Ares\Exceptions\ServerResponseException $e) {
    // no response from server or broken json
}

Other endpoints

Choose endpoint from class Sources. - SERVICE_* - available other endpoints - CORE - is main endpoint this is used in method $ares->loadBasic() - DIAL - use if you want list of value for example PravniForma - SER_NO_* are not exists, (*11)

use h4kuna\Ares;

/** @var Ares\Ares $ares */
$result = $ares->getAresClient()->useEndpoint(Ares\Ares\Sources::SERVICE_VR, '27082440');
var_dump($result);

Dials

Parameters kodCiselniku and zdrojCiselniku you can find in json file, on this page AresRestApi-verejne_v*.json, like a ciselnikKod: PravniForma, zdroj: res., (*12)

use h4kuna\Ares;

/** @var Ares\Ares $ares */
$result = $ares->getAresClient()->searchEndpoint(Ares\Ares\Sources::DIAL, [
    'kodCiselniku' => 'PravniForma',
    'zdrojCiselniku' => 'res',
])->ciselniky[0]->polozkyCiselniku;

foreach ($result as $item) {
    var_dump($item);
}

Data Box (datovƔ schƔnka)

Manual, (*13)

use h4kuna\Ares;
/** @var Ares\Ares $ares */
try {
    $response = $ares->loadDataBox('87744473');
    var_dump($response->ISDS);
} catch (h4kuna\Ares\Exceptions\ServerResponseException $e) {
    // catch error
}

VIES

Support base check., (*14)

use h4kuna\Ares;
/** @var Ares\Ares $ares */

try {
    $response = $ares->checkVatVies($vatNumber);
    var_dump($response->valid); // true / false
} catch (Ares\Exceptions\ServerResponseException $e) {
    // invalid VAT
}

The Versions

11/04 2018

dev-php7

dev-php7 https://github.com/h4kuna/ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

09/11 2017

dev-master

9999999-dev https://github.com/h4kuna/ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

14/09 2017

v1.2.0

1.2.0.0 https://github.com/h4kuna/ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

11/01 2017

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

11/01 2017

v1.0.7

1.0.7.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

22/11 2016

v1.1.3

1.1.3.0 https://github.com/h4kuna/ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

22/11 2016

v1.1.2

1.1.2.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

11/12 2015

v1.1.1

1.1.1.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

11/12 2015

v1.1.0

1.1.0.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

11/12 2015

dev-guzzle

dev-guzzle https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

26/06 2015

v1.0.6

1.0.6.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Milan Matějček

31/01 2014

v1.0.5

1.0.5.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

by Milan Matějček

28/01 2014

v1.0.4

1.0.4.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

by Milan Matějček

03/06 2013

v1.0.3

1.0.3.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

by Milan Matějček

15/03 2013

v1.0.2

1.0.2.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

by Milan Matějček

22/01 2013

v1.0.1

1.0.1.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

by Milan Matějček

09/12 2012

v1.0.0

1.0.0.0 https://github.com/h4kuna/ares

Download information about customer via his IN.

  Sources   Download

MIT

The Requires

 

by Milan Matějček