1
0
mirror of synced 2024-11-22 05:16:09 +03:00

error codes update;

This commit is contained in:
Grisha Pomadchin 2013-07-24 18:27:56 +04:00
parent 12d768772f
commit 1e16626047
2 changed files with 8 additions and 6 deletions

View File

@ -68,6 +68,7 @@ class ICrmOrderActions
// pack mode enable / disable
// can send data evry 500 rows
if (!$steps) {
while ($arOrder = $dbOrder->GetNext()) { //here orders by id asc; with offset
$order = self::orderCreate($arOrder['ID'], $api, $arParams);
@ -79,12 +80,12 @@ class ICrmOrderActions
$lastOrderId = $arOrder['ID'];
}
if (!empty($resOrders)) {
$orders = $api->orderUpload($resOrders);
// error pushing orders
if ($api->getStatusCode() != 200) {
if ($api->getStatusCode() != 201) {
//handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError());
@ -92,6 +93,7 @@ class ICrmOrderActions
return false; // in pack mode return errors
}
}
} else { // package mode (by default runs after install)
$orderCount = 0;
@ -112,7 +114,7 @@ class ICrmOrderActions
$orders = $api->orderUpload($resOrders);
// error pushing orders
if ($api->getStatusCode() != 200) {
if ($api->getStatusCode() != 201) {
//handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError());
@ -130,7 +132,7 @@ class ICrmOrderActions
$orders = $api->orderUpload($resOrders);
// error pushing orders
if ($api->getStatusCode() != 200) {
if ($api->getStatusCode() != 201) {
//handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError());

View File

@ -1,5 +1,5 @@
<?
$arModuleVersion = array(
'VERSION' => '0.3.5',
'VERSION_DATE' => '2013-07-24 17:28:00',
'VERSION_DATE' => '2013-07-24 18:27:00',
);