@param \Generated\Shared\Transfer\OrderTransfer $orderTransfer

@return bool
433693
public function isPaymentDataRequired(OrderTransfer $orderTransfer)
    {
        $paymentTransfer = $this->getPayment($orderTransfer);

        // Return early if we don't need the iban or bic data
        $paymentMethod = $paymentTransfer->getPaymentMethod();
        $whiteList = [
            PayoneApiConstants::PAYMENT_METHOD_E_WALLET,
            PayoneApiConstants::PAYMENT_METHOD_CREDITCARD_PSEUDO,
            PayoneApiConstants::PAYMENT_METHOD_ONLINE_BANK_TRANSFER,
        ];

        if (in_array($paymentMethod, $whiteList)) {
            return false;
        }

        return true;
    }
1012554
protected function prepareOrderItems(OrderTransfer $orderTransfer, AbstractRequestContainer $container): AbstractRequestContainer
    {
        $arrayIt = [];
        $arrayId = [];
        $arrayPr = [];
        $arrayNo = [];
        $arrayDe = [];
        $arrayVa = [];

        $key = 1;

        foreach ($orderTransfer->getItems() as $itemTransfer) {
            $arrayIt[$key] = PayoneApiConstants::INVOICING_ITEM_TYPE_GOODS;
            $arrayId[$key] = $itemTransfer->getSku();
            $arrayPr[$key] = $itemTransfer->getUnitGrossPrice();
            $arrayNo[$key] = $itemTransfer->getQuantity();
            $arrayDe[$key] = $itemTransfer->getName();
            $arrayVa[$key] = (int)$itemTransfer->getTaxRate();
            $key++;
        }

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

        return $container;
    }
540124
public function performRefundRequest(
        OrderTransfer $orderTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): ComputopApiRefundResponseTransfer {
        return $this
            ->getFactory()
            ->createRefundPaymentRequest()
            ->request($orderTransfer, $computopApiHeaderPayment);
    }
1278193
public function getProductListCustomerRelation(
        ProductListCustomerRelationTransfer $productListCustomerRelationTransfer
    ): ProductListCustomerRelationTransfer {
        $productListCustomerRelationTransfer->requireIdProductList();

        $customerIds = $this->productListCustomerRepository->getRelatedCustomerIdsByIdProductList(
            $productListCustomerRelationTransfer->getIdProductList()
        );

        $productListCustomerRelationTransfer->setCustomerIds($customerIds);

        return $productListCustomerRelationTransfer;
    }
400922
public function allowCancel($order)
    {
        // do not allow order to be canceled, if a shipping exists for the given
        // order that already is shipped
        if ($this->shippingManager->countByOrderId($order->getId(), array(ShippingStatus::STATUS_SHIPPED)) > 0) {
            return false;
        }

        return true;
    }
288779
public function saveProductListCustomerRelation(
        ProductListCustomerRelationTransfer $productListCustomerRelationTransfer
    ): ProductListCustomerRelationTransfer {
        return $this->getTransactionHandler()->handleTransaction(
            function () use ($productListCustomerRelationTransfer) {
                return $this->executeSaveProductListCustomerRelationTransaction($productListCustomerRelationTransfer);
            }
        );
    }
1373955
public function checkCondition(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponse): bool
    {
        $dateTimeUntil = new \DateTimeImmutable();
        if (Environment::getInstance()->isDevelopment()) {
            $dateTimeUntil = new \DateTimeImmutable('2019-02-27 11:23:36');
        }

        $dateTimeFrom = $dateTimeUntil->modify('-1 hour');

        $result = $this->conditionalAvailabilityClient->ConditionalAvailabilityLastPingSearch($dateTimeFrom, $dateTimeUntil);

        $isPassed = $result->getTotalHits() > 0;

        if ($isPassed) {
            return true;
        }

        $this->addAvailabilityErrorToCheckoutResponse($checkoutResponse);

        return false;
    }
1175352
protected function hasApiLogStatus(OrderTransfer $orderTransfer, $request, $status)
    {
        $idSalesOrder = $orderTransfer->getIdSalesOrder();
        $apiLog = $this->queryContainer->createApiLogsByOrderIdAndRequest($idSalesOrder, $request)->filterByStatus($status)->findOne();

        if ($apiLog === null) {
            return false;
        }

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

                return false;
            }
        }

        return true;
    }
1303928
public function generateReqIdFromOrderTransfer(OrderTransfer $orderTransfer): string
    {
        return $this->generateReqId(
            $orderTransfer->getTotals()->getHash(),
            $orderTransfer->getCustomer()->getCustomerReference() ?? static::GUEST_CUSTOMER_REFERENCE
        );
    }
637633
protected function createPaymentTransfer(OrderTransfer $orderTransfer): ComputopApiRequestTransfer
    {
        $computopApiRequestTransfer = parent::createPaymentTransfer($orderTransfer);
        $computopApiRequestTransfer->setCapture(
            $this->getCaptureType(ComputopApiConfig::PAYMENT_METHOD_PAY_NOW)
        );
        $computopApiRequestTransfer->setOrderDesc($this->getOrderDesc($this->computopApiService, $orderTransfer));

        return $computopApiRequestTransfer;
    }
1005795
public function isAuthorizationRedirect(OrderTransfer $orderTransfer)
    {
        return $this->hasApiLogStatus(
            $orderTransfer,
            PayoneApiConstants::REQUEST_TYPE_AUTHORIZATION,
            PayoneApiConstants::RESPONSE_TYPE_REDIRECT
        );
    }
35438
public function check(SpySalesOrderItem $orderItem)
    {
        $order = $orderItem->getOrder();

        if (isset(self::$resultCache[$this->getName()][$order->getPrimaryKey()])) {
            return self::$resultCache[$this->getName()][$order->getPrimaryKey()];
        }

        $orderTransfer = new OrderTransfer();
        $orderTransfer->fromArray($order->toArray(), true);

        $isSuccess = $this->callFacade($orderTransfer);
        self::$resultCache[$order->getPrimaryKey()] = $isSuccess;

        return $isSuccess;
    }
500025
public function isRefundError(OrderTransfer $orderTransfer)
    {
        return $this->hasApiLogStatus(
            $orderTransfer,
            PayoneApiConstants::REQUEST_TYPE_REFUND,
            PayoneApiConstants::RESPONSE_TYPE_ERROR
        );
    }
1039749
public function refundPayment(PayoneRefundTransfer $refundTransfer)
    {
        $payonePaymentTransfer = $refundTransfer->getPayment();

        $paymentEntity = $this->getPaymentEntity($payonePaymentTransfer->getFkSalesOrder());
        $paymentMethodMapper = $this->getPaymentMethodMapper($paymentEntity);
        $requestContainer = $paymentMethodMapper->mapPaymentToRefund($paymentEntity);
        $requestContainer->setAmount(0 - $paymentEntity->getSpyPaymentPayoneDetail()->getAmount());
        $requestContainer = $this->prepareOrderItems($refundTransfer->getOrder(), $requestContainer);
        $requestContainer = $this->prepareOrderShipment($refundTransfer->getOrder(), $requestContainer);
        $requestContainer = $this->prepareOrderDiscount($refundTransfer->getOrder(), $requestContainer);

        $this->setStandardParameter($requestContainer);

        $apiLogEntity = $this->initializeApiLog($paymentEntity, $requestContainer);

        $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
        $responseContainer = new RefundResponseContainer($rawResponse);

        $this->updateApiLogAfterRefund($apiLogEntity, $responseContainer);

        $responseMapper = new RefundResponseMapper();
        $responseTransfer = $responseMapper->getRefundResponseTransfer($responseContainer);

        return $responseTransfer;
    }
916532
protected function executeDeleteProductListTransaction(
        ProductListTransfer $productListTransfer
    ): void {
        foreach ($this->productListPreDeleters as $productListPreDeleters) {
            $productListPreDeleters->preDelete($productListTransfer);
        }

        parent::executeDeleteProductListTransaction($productListTransfer);
    }
702232
public function isPreAuthorizationRedirect(OrderTransfer $orderTransfer)
    {
        return $this->hasApiLogStatus(
            $orderTransfer,
            PayoneApiConstants::REQUEST_TYPE_PREAUTHORIZATION,
            PayoneApiConstants::RESPONSE_TYPE_REDIRECT
        );
    }