_id; } /** * Устанавливает id. * * @param string|null $id Идентификатор счета в ЮKassa. * * @return self */ public function setId(?string $id = null): self { $this->_id = $this->validatePropertyValue('_id', $id); return $this; } /** * Возвращает status. * * @return string|null Статус счета */ public function getStatus(): ?string { return $this->_status; } /** * Устанавливает status. * * @param string|null $status Статус счета * * @return self */ public function setStatus(?string $status = null): self { $this->_status = $this->validatePropertyValue('_status', $status); return $this; } /** * Возвращает cart. * * @return LineItem[]|ListObjectInterface|null Корзина заказа — список товаров или услуг, который отобразится на странице счета перед оплатой */ public function getCart(): ?ListObjectInterface { if ($this->_cart === null) { $this->_cart = new ListObject(LineItem::class); } return $this->_cart; } /** * Устанавливает cart. * * @param ListObjectInterface|LineItem[]|array|null $cart Корзина заказа — список товаров или услуг, который отобразится на странице счета перед оплатой * * @return self */ public function setCart(mixed $cart = null): self { $this->_cart = $this->validatePropertyValue('_cart', $cart); return $this; } /** * Возвращает delivery_method. * * @return AbstractDeliveryMethod|DeliveryMethodSelf|null Данные о выбранном способе доставки счета */ public function getDeliveryMethod(): ?AbstractDeliveryMethod { return $this->_delivery_method; } /** * Устанавливает delivery_method. * * @param AbstractDeliveryMethod|array|null $delivery_method Данные о выбранном способе доставки счета * * @return self */ public function setDeliveryMethod(mixed $delivery_method = null): self { if (is_array($delivery_method)) { $delivery_method = (new DeliveryMethodFactory())->factoryFromArray($delivery_method); } $this->_delivery_method = $this->validatePropertyValue('_delivery_method', $delivery_method); return $this; } /** * Возвращает payment_details. * * @return PaymentDetails|null Данные о платеже по выставленному счету */ public function getPaymentDetails(): ?PaymentDetails { return $this->_payment_details; } /** * Устанавливает payment_details. * * @param PaymentDetails|array|null $payment_details Данные о платеже по выставленному счету * * @return self */ public function setPaymentDetails(mixed $payment_details = null): self { $this->_payment_details = $this->validatePropertyValue('_payment_details', $payment_details); return $this; } /** * Возвращает created_at. * * @return DateTime|null Дата и время создания счета на оплату */ public function getCreatedAt(): ?DateTime { return $this->_created_at; } /** * Устанавливает created_at. * * @param DateTime|string|null $created_at Дата и время создания счета на оплату * * @return self */ public function setCreatedAt(DateTime|string|null $created_at = null): self { $this->_created_at = $this->validatePropertyValue('_created_at', $created_at); return $this; } /** * Возвращает expires_at. * * @return DateTime|null Срок действия счета */ public function getExpiresAt(): ?DateTime { return $this->_expires_at; } /** * Устанавливает expires_at. * * @param DateTime|array|null $expires_at Срок действия счета * * @return self */ public function setExpiresAt(mixed $expires_at = null): self { $this->_expires_at = $this->validatePropertyValue('_expires_at', $expires_at); return $this; } /** * Возвращает description. * * @return string|null Описание выставленного счета */ public function getDescription(): ?string { return $this->_description; } /** * Устанавливает description. * * @param string|null $description Описание выставленного счета (не более 128 символов), которое вы увидите в личном кабинете ЮKassa, а пользователь на странице счета. Например: «Счет на оплату по договору 37». * * @return self */ public function setDescription(?string $description = null): self { $this->_description = $this->validatePropertyValue('_description', $description); return $this; } /** * Возвращает cancellation_details. * * @return InvoiceCancellationDetails|null Комментарий к статусу `canceled` */ public function getCancellationDetails(): ?InvoiceCancellationDetails { return $this->_cancellation_details; } /** * Устанавливает cancellation_details. * * @param InvoiceCancellationDetails|array|null $cancellation_details Комментарий к статусу `canceled` * * @return self */ public function setCancellationDetails(mixed $cancellation_details = null): self { $this->_cancellation_details = $this->validatePropertyValue('_cancellation_details', $cancellation_details); return $this; } /** * Возвращает metadata. * * @return Metadata|null Любые дополнительные данные */ public function getMetadata(): ?Metadata { return $this->_metadata; } /** * Устанавливает metadata. * * @param Metadata|array|null $metadata Любые дополнительные данные, которые нужны вам для работы (например, ваш внутренний идентификатор заказа). * * @return self */ public function setMetadata(mixed $metadata = null): self { $this->_metadata = $this->validatePropertyValue('_metadata', $metadata); return $this; } }