1
0
Fork 0
mirror of synced 2025-04-16 15:41:06 +00:00

update readme

This commit is contained in:
Alex Lushpai 2017-06-18 03:47:37 +03:00
parent 68a2ff4ba0
commit c01f88553a
3 changed files with 16 additions and 13 deletions

View file

@ -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',

View file

@ -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',

View file

@ -10,8 +10,9 @@
<!-- Dummy values used to provide credentials. No need to change these. -->
<php>
<server name="CRM_URL" value="https://demo.retailcrm.ru" />
<server name="CRM_API_URL" value="https://demo.retailcrm.ru" />
<server name="CRM_API_KEY" value="nSBFWecViONG5c96wUQQgZzHkilTnaa6" />
<server name="CRM_API_VERSION" value="v5" />
<server name="CRM_USER_ID" value="1" />
</php>