From 548d466bd0d289bd6f50fda5ecd723b4f2694975 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Wed, 27 May 2020 16:00:44 +0300 Subject: [PATCH] Closes #117 - updated from retailcrm/api-client-php (#129) --- 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`' + ) ); }