1
0
Fork 0
mirror of synced 2025-04-20 01:21:01 +00:00

failsafe for incorrect proxy calling, fix for customersCorporateCreate

This commit is contained in:
Pavel 2020-03-13 11:57:32 +03:00 committed by gorokh
parent 4060df418a
commit d01a5ae0aa
2 changed files with 15 additions and 1 deletions

View file

@ -471,6 +471,20 @@ class RCrmActions
try {
$result = call_user_func_array(array($api, $methodApi), $params);
if (!$result) {
$err = new RuntimeException(
$methodApi . ": Got null instead of valid result!"
);
Logger::getInstance()->write(sprintf(
'%s%s%s',
$err->getMessage(),
PHP_EOL,
$err->getTraceAsString()
), 'apiErrors');
return false;
}
if ($result->getStatusCode() !== 200 && $result->getStatusCode() !== 201) {
if ($methodApi == 'ordersGet'
|| $methodApi == 'customersGet'

View file

@ -102,7 +102,7 @@ class RetailCrmCorporateClient
Logger::getInstance()->write($customerCorporate, 'clientCorporate');
if ($send) {
$result = RCrmActions::apiMethod($api, 'customersСorporateСreate', __METHOD__, $customerCorporate, $site);
$result = RCrmActions::apiMethod($api, 'customersCorporateCreate', __METHOD__, $customerCorporate, $site);
if (!$result) {
return false;
}