diff --git a/README.md b/README.md index 48785d9..c5e35ee 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Use [API documentation](http://retailcrm.github.io/api-client-php) ## Requirements -* PHP 5.3 and above +* PHP 5.4 and above * PHP's cURL support ## Install @@ -29,12 +29,12 @@ require 'path/to/vendor/autoload.php'; ```php $client = new \RetailCrm\ApiClient( 'https://demo.retailcrm.ru', - 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH' + 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH', + 'v5' ); - try { - $response = $client->ordersGet('M-2342'); + $response = $client->request->ordersGet('M-2342'); } catch (\RetailCrm\Exception\CurlException $e) { echo "Connection error: " . $e->getMessage(); } @@ -64,11 +64,12 @@ if ($response->isSuccessful()) { $client = new \RetailCrm\ApiClient( 'https://demo.retailcrm.pro', - 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH' + 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH', + 'v4' ); try { - $response = $client->ordersCreate(array( + $response = $client->request->ordersCreate(array( 'externalId' => 'some-shop-order-id', 'firstName' => 'Vasily', 'lastName' => 'Pupkin', diff --git a/README.ru.md b/README.ru.md index c9819d3..6b5d1ea 100644 --- a/README.ru.md +++ b/README.ru.md @@ -6,7 +6,7 @@ PHP-клиент для работы с [retailCRM API](http://www.retailcrm.ru/ ## Обязательные требования -* PHP версии 5.3 и выше +* PHP версии 5.4 и выше * PHP-расширение cURL ## Установка @@ -31,12 +31,12 @@ require 'path/to/vendor/autoload.php'; ```php $client = new \RetailCrm\ApiClient( 'https://demo.retailcrm.ru', - 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH' + 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH', + 'v5' ); - try { - $response = $client->ordersGet('M-2342'); + $response = $client-request->ordersGet('M-2342'); } catch (\RetailCrm\Exception\CurlException $e) { echo "Сетевые проблемы. Ошибка подключения к retailCRM: " . $e->getMessage(); } @@ -66,11 +66,12 @@ if ($response->isSuccessful()) { $client = new \RetailCrm\ApiClient( 'https://demo.retailcrm.ru', - 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH' + 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH', + 'v4' ); try { - $response = $client->ordersCreate(array( + $response = $client-request->ordersCreate(array( 'externalId' => 'some-shop-order-id', 'firstName' => 'Vasily', 'lastName' => 'Pupkin', diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d735181..d7af0d9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,8 +10,9 @@ - + +