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; }