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

@throws \Pav\Zed\Document\Business\Exception\NoDocumentFoundException
@return false|resource
182258
public function readDocument(TransferInterface $transfer, $containerName)
    {
        $this->checkTransferMethods($transfer);

        $fileName = $transfer->getFileName();
        $relativePath = $transfer->getRelativePath();

        if (!$this->documentExists($transfer, $containerName)) {
            throw new NoDocumentFoundException(
                sprintf(
                    'No File "%s" found for type %s',
                    $fileName,
                    $containerName
                )
            );
        }

        return $this->fileUploadFacade->readFileStream($containerName, $fileName, $relativePath);
    }
1027046
public function canCreate(ContainerInterface $container, $requestedName)
    {
        $config = $container->get('config');

        return isset($config[static::KEY_DATASOURCE][$requestedName]);
    }
550237
public function deleteFile($containerName, $fileName, $relativePath)
    {
        $fullFileName = $this->getFullFileName($containerName, $fileName, $relativePath);

        return $this->filesystem->delete($fullFileName);
    }
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;
    }
1101867
public function createDocument(TransferInterface $transfer, $containerName)
    {
        $this->checkTransferMethods($transfer);

        if ($transfer->getFileName() === null) {
            throw new NoFileNameSetException(
                'No filename defined for Transfer.'
            );
        }

        $fileName = $transfer->getFileName();
        $relativePath = $transfer->getRelativePath();

        if (!$this->documentExists($transfer, $containerName)) {

            $fullFilePath = $this->createFullFilePath($fileName);
            $this->renderFile($transfer, $containerName, $fullFilePath);

            $fileInfo = new \SplFileInfo($fullFilePath);

            $this->fileUploadFacade->saveFile($containerName, $fileInfo, $relativePath);
        }

        return $transfer;
    }
981936
public function call($url, TransferInterface $object, $requestOptions = null): TransferInterface
    {
        return $this->zedRequestClient->call($url, $object, $requestOptions);
    }
458280
public function fileExists($containerName, $fileName, $relativePath)
    {
        return $this->fileUploadFacade->fileExists($containerName, $fileName, $relativePath);
    }
214347
public function toTransactionResponseTransfer(StreamInterface $response): TransferInterface
    {
        $decryptedResponse = $this->decryptResponse($response);

        return $this->getResponseTransfer($decryptedResponse);
    }
457170
public function fileExists($containerName, $fileName, $relativePath)
    {
        return $this->getFactory()
            ->createStorage($containerName)
            ->fileExists($containerName, $fileName, $relativePath);
    }
1092635
public function readFileStream($containerName, $fileName, $relativePath)
    {
        return $this->fileUploadFacade->readFileStream($containerName, $fileName, $relativePath);
    }
511827
public function loadContainer($containerPath)
    {
        $containerPath = realpath($containerPath);

        if (false === $containerPath) {
            return false;
        }

        $this->container = new ContainerBuilder();

        try {
            $loader = new XmlFileLoader($this->container, new FileLocator(dirname($containerPath)));
            $loader->load(basename($containerPath));

            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
476108
public function deleteDocument(TransferInterface $transfer, $containerName)
    {
        return $this->getFactory()
            ->createPdfDocumentManager()
            ->deleteDocument($transfer, $containerName);
    }
602882
public function transferCredit(Transfer $transfer)
    {
        $transfer->setRequiredFields(array(
            'amount',
            'linkedAccount',
            'merchantRefNum',
        ));
        $transfer->setOptionalFields(array(
            'detail',
            'dupCheck',
        ));

        $request = new Request(array(
               'method' => Request::POST,
               'uri' => $this->prepareURI($this->creditPath),
               'body' => $transfer
           ));

        $response = $this->client->processRequest($request);

        return new Transfer($response);
    }
279984
public function mapPaymentToAuthorization(SpyPaymentPayone $paymentEntity, OrderTransfer $orderTransfer): AuthorizationContainerInterface
    {
        $authorizationContainer = new AuthorizationContainer();
        $authorizationContainer = $this->mapPaymentToAbstractAuthorization($paymentEntity, $authorizationContainer);
        $authorizationContainer = $this->mapEmail($paymentEntity, $authorizationContainer);
        $authorizationContainer = $this->mapBusinessRelation($authorizationContainer);
        $authorizationContainer->setAmount($orderTransfer->getTotals()->getGrandTotal());

        return $authorizationContainer;
    }
1209033
public function documentExists(TransferInterface $transfer, $containerName)
    {
        $this->checkTransferMethods($transfer);

        $fileName = $transfer->getFileName();
        $relativePath = $transfer->getRelativePath();

        return $this->fileUploadFacade->fileExists($containerName, $fileName, $relativePath);
    }
300881
private function ensureTransportExists(ContainerBuilder $container, string $busName, string $transport): void
    {
        $serviceId = 'gdbots_pbjx.transport.' . $transport;
        if ($container->hasDefinition($serviceId)) {
            return;
        }

        throw new \LogicException(
            sprintf(
                'The "gdbots_pbjx.%s_bus.transport" is configured to use "%s" which requires service "%s".',
                $busName,
                $transport,
                $serviceId
            )
        );
    }
820590
public function outputPdf(TransferInterface $transfer, $containerName)
    {
        $pdfTransfer = $this->convertToPdfTransfer($transfer, $containerName);

        return $this->pdfBridge->outputPdfFile($pdfTransfer);
    }