currentObject->setPaymentId($value); return $this; } /** * Устанавливает комментарий к возврату * @param string $value Комментарий к возврату * @return CreateRefundRequestBuilder Инстанс текущего билдера * * @throws InvalidPropertyValueTypeException Выбрасывается если была передана не строка */ public function setDescription($value) { $this->currentObject->setDescription($value); return $this; } /** * Устанавливает источники возврата * * @param SourceInterface[]|array $value Массив трансферов * * @return self Инстанс билдера запросов */ public function setSources($value) { $this->currentObject->setSources($value); return $this; } /** * Устанавливает сделку * @param RefundDealData|array|null $value Данные о сделке, в составе которой проходит возврат * @throws InvalidPropertyValueTypeException * * @return CreateRefundRequestBuilder Инстанс билдера запросов */ public function setDeal($value) { if ($value === null) { return $this; } if ($value instanceof RefundDealData) { $this->deal = $value; } elseif (is_array($value)) { $this->deal = new RefundDealData($value); } else { throw new InvalidPropertyValueTypeException( 'Invalid deal value type in CreateRefundRequest', 0, 'CreateRefundRequest.deal', $value ); } return $this; } /** * Строит объект запроса к API * @param array|null $options Устанавливаемые параметры запроса * @return CreateRefundRequestInterface|AbstractRequest Инстанс сгенерированного объекта запроса к API */ public function build(array $options = null) { if (!empty($options)) { $this->setOptions($options); } $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(); } }