From cf31c1eb30be5c1a4ea7b703fab55e6b52e2165d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Tue, 26 May 2020 17:39:33 +0300 Subject: [PATCH] Closes #117 - updated from retailcrm/api-client-php --- src/include/api/class-wc-retailcrm-client-v5.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/include/api/class-wc-retailcrm-client-v5.php b/src/include/api/class-wc-retailcrm-client-v5.php index 222f784..f83e972 100644 --- a/src/include/api/class-wc-retailcrm-client-v5.php +++ b/src/include/api/class-wc-retailcrm-client-v5.php @@ -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`' + ) ); }