setOptions($options); } if (!empty($this->transfers)) { $this->currentObject->setTransfers($this->transfers); } if ($this->amount->getValue() > 0) { $this->currentObject->setAmount($this->amount); } if ($this->receipt->notEmpty()) { $this->currentObject->setReceipt($this->receipt); } if ($this->deal) { $this->currentObject->setDeal($this->deal); } return parent::build(); } /** * Устанавливает сделку * @param CaptureDealData|array|null $value Данные о сделке, в составе подтверждения оплаты * @throws InvalidPropertyValueTypeException * * @return CreateCaptureRequestBuilder Инстанс билдера запросов */ public function setDeal($value) { if ($value === null) { return $this; } if ($value instanceof CaptureDealData) { $this->deal = $value; } elseif (is_array($value)) { $this->deal = new CaptureDealData($value); } else { throw new InvalidPropertyValueTypeException( 'Invalid deal value type in CreateCaptureRequest', 0, 'CreateCaptureRequest.deal', $value ); } return $this; } }