From 8ad288c8aadcee5935d72cea6846854ba791c699 Mon Sep 17 00:00:00 2001 From: VKoptev Date: Thu, 15 Feb 2024 16:52:26 +0300 Subject: [PATCH] fix empty params --- src/Postback.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Postback.php b/src/Postback.php index aefda34..b892f30 100644 --- a/src/Postback.php +++ b/src/Postback.php @@ -101,15 +101,21 @@ protected function mapProperty(string $key): array switch ($key) { case "status": - $query[$param] = $this->status->value(); + if (is_null($this->status)) { + $query[$param] = $this->status->value(); + } break; case "customFields": foreach ($this->customFields as $i => $value) { - $query[$param . $i] = $value; + if (!is_null($value)) { + $query[$param . $i] = $value; + } } break; default: - $query[$param] = $this->$key; + if (!is_null($this->$key)) { + $query[$param] = $this->$key; + } break; }