@param \Spryker\Shared\Transfer\TransferInterface $transfer
@param string $containerName

@throws \Pav\Zed\Document\Business\Exception\NoDocumentFoundException
@return false|resource
960797
public function readPdfDocument(TransferInterface $transfer, $containerName)
    {
        return $this->getFactory()
            ->createPdfDocumentManager()
            ->readDocument($transfer, $containerName);
    }
297694
public function hasSufficientFunds($amount, $vendor, $transfer = false)
    {
        $balance = round($this->hipay->getBalance($vendor), static::SCALE);

        if ($balance < round($amount, static::SCALE)) {
            if ($transfer) {
                throw new WrongWalletBalance('technical', 'transfer', $amount, $balance);
            }

            throw new WrongWalletBalance($vendor->getHipayId(), 'withdraw', $amount, $balance);
        }
    }
444610
protected function sendRequest(string $hostname, array $params): string
    {
        $url = $hostname . "?" . http_build_query($params);

        $response = $this->getClient()->request("GET", $url);

        if ($response->getStatusCode() != "200") {
            throw new ProviderException("Failed to call the external text-to-speech service");
        }

        return $response->getBody();
    }
693518
private function doSendRequest(RequestInterface $request)
    {
        try {
            $response = $this->getHttpClient()->sendRequest($request);
        } catch (HttpTransferException $e) {
            throw new TransferException(
                $e->getMessage(),
                $request,
                $e instanceof HttpException ? $e->getResponse() : null
            );
        }

        if ($response->getStatusCode() >= 400) {
            throw new InvalidResponseException('Bad response status code.', $request, $response);
        }

        $rawData = (string) $response->getBody();

        if (empty($rawData)) {
            return null;
        }

        $data = json_decode($rawData, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new InvalidResponseException('Could not decode the response.', $request, $response);
        }

        return $data;
    }
617581
private function returnTransfertToPlain()
    {
        if ($this->returnTransfert()) {
            if (!curl_setopt($this->ch, CURLOPT_TRANSFERTEXT, true)) {
                $this->close();

                return false;
            }
        }

        return true;
    }
885907
protected function prepareOrderDiscount(OrderTransfer $orderTransfer, AbstractRequestContainer $container): AbstractRequestContainer
    {
        $arrayIt = $container->getIt() ?? [];
        $arrayId = $container->getId() ?? [];
        $arrayPr = $container->getPr() ?? [];
        $arrayNo = $container->getNo() ?? [];
        $arrayDe = $container->getDe() ?? [];
        $arrayVa = $container->getVa() ?? [];

        $key = count($arrayId) + 1;

        $arrayIt[$key] = PayoneApiConstants::INVOICING_ITEM_TYPE_VOUCHER;
        $arrayId[$key] = PayoneApiConstants::INVOICING_ITEM_TYPE_VOUCHER;
        $arrayPr[$key] = - $orderTransfer->getTotals()->getDiscountTotal();
        $arrayNo[$key] = 1;
        $arrayDe[$key] = 'Discount';

        $container->setIt($arrayIt);
        $container->setId($arrayId);
        $container->setPr($arrayPr);
        $container->setNo($arrayNo);
        $container->setDe($arrayDe);
        $container->setVa($arrayVa);

        return $container;
    }
58638
public function saveUploadedFile($containerName, UploadedFile $file, $relativePath)
    {
        if ($file->isValid() === false) {
            return false;
        }

        $fileName = $file->getClientOriginalName();
        $filePath = $this->getFullFileName($containerName, $fileName);

        return $this->move($file->getRealPath(), $filePath);
    }
812303
protected function useInMemoryTransports(InputInterface $input, ?SymfonyStyle $io = null): void
    {
        if ($input->getOption('in-memory')) {
            $locator = $this->getPbjxServiceLocator();
            if ($locator instanceof ContainerAwareServiceLocator) {
                $locator->forceTransportsToInMemory();
                if ($io) {
                    $io->note('Using in_memory transports.');
                }
            }
        }
    }
1267793
public function streamBlob($container, $blobName, $params = [])
    {
        try {
            $this->checkConnection();
            ///** @var GetBlobResult $blob */
            //$blob = $this->blobConn->getBlob($container, $blobName);
            $props = $this->blobConn->getBlobProperties($container, $blobName)->getProperties();
            $size = $props->getContentLength();
            $chunk = \Config::get('df.file_chunk_size');
            $index = 0;

            header('Last-Modified: ' . gmdate(static::TIMESTAMP_FORMAT, $props->getLastModified()->getTimestamp()));
            header('Content-Type: ' . $props->getContentType());
            header('Content-Transfer-Encoding: ' . $props->getContentEncoding());
            header('Content-Length:' . $size);

            $disposition =
                (isset($params['disposition']) && !empty($params['disposition'])) ? $params['disposition'] : 'inline';

            header("Content-Disposition: $disposition; filename=\"$blobName\";");
            ob_clean();

            while ($index < $size) {
                $option = new GetBlobOptions();
                $option->setRangeStart($index);
                $option->setRangeEnd($index + $chunk - 1);
                $blob = $this->blobConn->getBlob($container, $blobName, $option);
                $stream = $blob->getContentStream();
                $length = $blob->getProperties()->getContentLength();
                $index += $length;
                flush();
                fpassthru($stream);
            }
        } catch (\Exception $ex) {
            if ($ex instanceof ServiceException) {
                $code = $ex->getCode();
                $status_header = "HTTP/1.1 $code";
                header($status_header);
                header('Content-Type: text/html');
                echo 'Failed to stream/download file. File ' . $blobName . ' was not found. ' . $ex->getMessage();
            } else {
                throw new DfException('Failed to stream blob: ' . $ex->getMessage());
            }
        }
    }
1039826
public function addBrandTransferExpanderPlugins(Container $container): Container
    {
        $container[static::PLUGINS_BRAND_TRANSFER_EXPANDER] = function (Container $container) {
            return $this->getBrandTransferExpanderPlugins();
        };

        return $container;
    }
458936
public function mapAddressCheck(QuoteTransfer $quoteTransfer): ContainerInterface
    {
        /** @var \SprykerEco\Zed\Payone\Business\Api\Request\Container\AddressCheckContainer $container */
        $container = $this->riskCheckFactory->createAddressCheckContainer();
        $container = $this->mapDefaultContainerParams($container);

        $container->setFirstName($quoteTransfer->getBillingAddress()->getFirstName());
        $container->setLastName($quoteTransfer->getBillingAddress()->getLastName());
        $container->setCompany($quoteTransfer->getBillingAddress()->getCompany());
        $container->setCountry($quoteTransfer->getBillingAddress()->getIso2Code());
        $container->setStreetName($quoteTransfer->getBillingAddress()->getAddress1());
        $container->setStreetNumber($quoteTransfer->getBillingAddress()->getAddress2());
        $container->setZip($quoteTransfer->getBillingAddress()->getZipCode());
        $container->setCity($quoteTransfer->getBillingAddress()->getCity());
        $container->setAddressCheckType($this->payoneConfig->getAddressCheckType());

        return $container;
    }
323359
public function documentExists(TransferInterface $transfer, $containerName)
    {
        return $this->getFactory()
            ->createPdfDocumentManager()
            ->documentExists($transfer, $containerName);
    }
171321
public function deleteFile($containerName, $fileName, $relativePath)
    {
        return $this->fileUploadFacade->deleteFile($containerName, $fileName, $relativePath);
    }
296496
public function execute($returnTransfer = TRUE) {
        //Need transfer return
        if($returnTransfer === TRUE) {
            $this->setOption(CURLOPT_RETURNTRANSFER, 1);
        }

        $result = curl_exec($this->handler);

        //Error handling
        if(curl_errno($this->handler)) {
            $format = [curl_errno($this->handler), curl_error($this->handler)];
            $this->close();
            throw RuntimeException::createByFormat('Error executing request, error code: %s, Message: %s', $format);
        }

        return $result;
    }
270465
public function fillFieldWithValue(string $fieldName, $value, ?string $containerName = null): void
    {
        $newContainerName = (!$containerName) ? $containerName : sprintf($this::NEW_FIELD_TITLE_PATTERN, EzFieldElement::getFieldInternalNameByName($containerName));
        $fieldElement = $this->getField($fieldName, $newContainerName);
        $fieldElement->setValue($value);
    }
32195
protected function checkTransferMethods(TransferInterface $transfer)
    {
        if (!method_exists($transfer, 'getFileName') || !method_exists($transfer, 'getRelativePath')) {
            throw new TransferHasNoFileNamePropertyException(
                sprintf(
                    'Transfer %s has no file-name or no relative-path property.',
                    get_class($transfer)
                )
            );
        }
    }
1286353
public function addPrepend(ContainerInterface $container, $name = null)
    {
        if ($name !== null) {
            unset($this->containers[$name]);
            $this->containers = array_merge([$name => $container], $this->containers);
        } else {
            array_unshift($this->containers, $container);
        }
    }