1
0
mirror of synced 2025-01-18 17:01:41 +03:00

Closes #117 - updated from retailcrm/api-client-php (#129)

This commit is contained in:
Pavel 2020-05-27 16:00:44 +03:00 committed by GitHub
parent d0dfc39da0
commit 548d466bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,9 +274,12 @@ class WC_Retailcrm_Client_V5
);
}
if (empty($entity) || $entity != 'customer' || $entity != 'order') {
if (empty($entity) || !in_array($entity, ['customer', 'order', 'customer_corporate', 'company'])) {
throw new \InvalidArgumentException(
'Parameter `entity` must contain a data & value must be `order` or `customer`'
sprintf(
'Parameter `entity` must contain a data & value must be %s',
'`order`, `customer`, `customer_corporate` or `company`'
)
);
}