username = $order->getCustomerEmail() ?? null; $this->fullName = $order->getCustomerName() ?? null; $this->primaryPhone = $order->getBillingAddress()?->getTelephone() ?? $order->getShippingAddress()->getTelephone(); $this->email = $order->getBillingAddress()?->getEmail() ?? $order->getShippingAddress()->getEmail(); } public function jsonSerialize(): mixed { return get_object_vars($this); } }