retailcrm / api-client-php

PHP client for RetailCRM API
http://www.retailcrm.ru
MIT License
60 stars 58 forks source link

Wrong type of "success" param in response #33

Closed Lexa-san closed 7 years ago

Lexa-san commented 7 years ago

Sometimes Response object has string values in bool parameters.

E.g. in good conditions when I try to get order list by URL like https://demo.retailcrm.ru/api/v4/orders?apiKey=... I see in JSON in response object success parameter with value true (type is bool):

{
...
    "success": true
...
}

But when something is wrong (just lost one symbol from account name) https://dem.retailcrm.ru/api/v4/orders?apiKey=.. in JSON I see string value "false" of success parameter:

{
    "errorMsg": "Account does not exist.",
    "success": "false"
}

In bad way ApiResponse::getSuccess() works wrong.

muxx commented 7 years ago

This is not api client error thats why i close this issue. But thanks, we will fix this bug.