{@inheritdoc}

@api

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

@return \Generated\Shared\Transfer\ComputopApiRefundResponseTransfer
540124
public function performRefundRequest(
        OrderTransfer $orderTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): ComputopApiRefundResponseTransfer {
        return $this
            ->getFactory()
            ->createRefundPaymentRequest()
            ->request($orderTransfer, $computopApiHeaderPayment);
    }
1139680
public function generateEncryptedMac(ComputopApiRequestTransfer $requestTransfer): string
    {
        $value = $this->getFactory()->createComputopApiMapper()->getPlaintextMac($requestTransfer);

        return $this->getHashValue($value);
    }
1158296
protected function getResponseTransfer(array $response): ComputopApiReverseResponseTransfer
    {
        $computopApiResponseTransfer = new ComputopApiReverseResponseTransfer();
        $computopApiResponseTransfer->setHeader(
            $this->computopApiService->extractResponseHeader($response, $this->config->getReverseMethodName())
        );
        //optional fields
        $computopApiResponseTransfer->setAId($this->computopApiService->getResponseValue($response, ComputopApiConfig::A_ID));
        $computopApiResponseTransfer->setTransactionId($this->computopApiService->getResponseValue($response, ComputopApiConfig::TRANSACTION_ID));
        $computopApiResponseTransfer->setCodeExt($this->computopApiService->getResponseValue($response, ComputopApiConfig::CODE_EXT));
        $computopApiResponseTransfer->setErrorText($this->computopApiService->getResponseValue($response, ComputopApiConfig::ERROR_TEXT));
        $computopApiResponseTransfer->setRefNr($this->computopApiService->getResponseValue($response, ComputopApiConfig::REF_NR));

        return $computopApiResponseTransfer;
    }
793211
public function buildRequest(
        QuoteTransfer $quoteTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): array {
        $encryptedRequestData = $this->encryptRequestData($quoteTransfer, $computopApiHeaderPayment);

        $data = $encryptedRequestData[ComputopApiConstants::DATA];
        $length = $encryptedRequestData[ComputopApiConstants::LENGTH];
        $merchantId = $this->config->getMerchantId();

        return $this->buildRequestData($data, $length, $merchantId);
    }
1301294
public function getPaymentDetailAction(PayoneGetPaymentDetailTransfer $getPaymentDetailTransfer)
    {
        if (!empty($getPaymentDetailTransfer->getOrderReference())) {
            $order = SpySalesOrderQuery::create()
                ->filterByOrderReference($getPaymentDetailTransfer->getOrderReference())
                ->findOne();
            $getPaymentDetailTransfer->setOrderId($order->getIdSalesOrder());
        }
        $response = $this->getFacade()->getPaymentDetail($getPaymentDetailTransfer->getOrderId());
        $getPaymentDetailTransfer->setPaymentDetail($response);
        return $getPaymentDetailTransfer;
    }
297422
protected function hydrateQuoteWithCustomer(
        QuoteTransfer $quoteTransfer,
        PayonePaypalExpressCheckoutGenericPaymentResponseTransfer $details
    ) {
        $customerEmail = $details->getEmail();
        $customerTransfer = new CustomerTransfer();
        $customerTransfer->setEmail($customerEmail);
        $customerTransfer = $this->customerClient->getCustomerByEmail($customerTransfer);

        if (!empty($customerTransfer->getFirstName())) {
            $quoteTransfer->setCustomer($customerTransfer);
            return $quoteTransfer;
        }
        $customerTransfer->setIsGuest(true);
        $customerTransfer->setFirstName($details->getShippingFirstName());
        $customerTransfer->setLastName($details->getShippingLastName());
        $customerTransfer->setCompany($details->getShippingCompany());
        $customerTransfer->setEmail($customerEmail);
        $quoteTransfer->setCustomer($customerTransfer);

        return $quoteTransfer;
    }
1154630
public function sendConsumerScoreRequest(QuoteTransfer $quoteTransfer): ConsumerScoreResponseTransfer
    {
        $requestContainer = $this->riskCheckMapper->mapConsumerScoreCheck($quoteTransfer);

        $response = $this->executionAdapter->sendRequest($requestContainer);

        $responseContainer = $this->riskCheckFactory->createConsumerScoreResponseContainer();
        $responseContainer->init($response);

        $consumerScoreResponseTransfer = new ConsumerScoreResponseTransfer();
        $consumerScoreResponseTransfer->setStatus($responseContainer->getStatus());

        if (!$responseContainer->isError()) {
            $consumerScoreResponseTransfer->setScore($responseContainer->getScore());
            $consumerScoreResponseTransfer->setScoreValue($responseContainer->getScorevalue());

            return $consumerScoreResponseTransfer;
        }

        $consumerScoreResponseTransfer->setCustomerMessage($responseContainer->getCustomermessage());

        return $consumerScoreResponseTransfer;
    }
712522
public function mapQuoteTransferToGenericPayment(
        GenericPaymentContainer $genericPayment,
        QuoteTransfer $quoteTransfer
    ) {

        $genericPayment->setAmount($quoteTransfer->getTotals()->getGrandTotal());
        $genericPayment->setWorkOrderId(
            $quoteTransfer->getPayment()
                ->getPayonePaypalExpressCheckout()->getWorkOrderId()
        );
        return $genericPayment;
    }
652351
public function performEasyCreditAuthorizeRequest(
        OrderTransfer $orderTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): ComputopApiAuthorizeResponseTransfer {
        return $this
            ->getFactory()
            ->createEasyCreditAuthorizeRequest()
            ->request($orderTransfer, $computopApiHeaderPayment);
    }
771832
public function expandCustomerTransferWithProductListIds(CustomerTransfer $customerTransfer): CustomerTransfer
    {
        $customerTransfer->setCustomerProductListCollection(new CustomerProductListCollectionTransfer());

        $productListCollectionTransfer = $this->productListReader->getProductListCollectionByIdCustomerId(
            $customerTransfer
        );

        $this->addProductListsToCustomerTransfer($customerTransfer, $productListCollectionTransfer);

        return $customerTransfer;
    }
596589
public function update(RestCompaniesRequestTransfer $restCompaniesRequestTransfer): RestCompaniesResponseTransfer
    {
        $companyTransfer = $this->companiesRestApiRepository
            ->findCompanyByExternalReference($restCompaniesRequestTransfer->getId());

        if ($companyTransfer === null) {
            return $this->createCompanyFailedToLoadErrorResponseTransfer();
        }

        foreach ($this->companyMapperPlugins as $companyMapperPlugin) {
            $companyTransfer = $companyMapperPlugin->map(
                $restCompaniesRequestTransfer->getRestCompaniesRequestAttributes(),
                $companyTransfer
            );
        }

        try {
            $companyResponseTransfer = $this->companyFacade->update($companyTransfer);
        } catch (PropelException $e) {
            return $this->createCompanyDataInvalidErrorResponse();
        }

        if (!$companyResponseTransfer->getIsSuccessful()) {
            return $this->createCompanyDataInvalidErrorResponse();
        }

        return $this->createCompanyResponseTransfer(
            $companyResponseTransfer->getCompanyTransfer()
        );
    }
160386
public function getDataSubArray(ComputopApiRequestTransfer $computopApiRequestTransfer): array
    {
        $dataSubArray = parent::getDataSubArray($computopApiRequestTransfer);
        $dataSubArray[ComputopApiConfig::DATE] = $computopApiRequestTransfer->getDate();

        $dataSubArray[ComputopApiConfig::REASON] = ComputopApiConfig::REASON_FULL_CANCELL;

        return $dataSubArray;
    }
496103
public static AlipayFundTransToaccountTransferResponse transferToResponse(
			AlipayFundTransToaccountTransferModel model) throws AlipayApiException {
		AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
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;
    }
1117045
public function performReverseRequest(
        OrderTransfer $orderTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): ComputopApiReverseResponseTransfer {
        return $this
            ->getFactory()
            ->createReversePaymentRequest()
            ->request($orderTransfer, $computopApiHeaderPayment);
    }
288779
public function saveProductListCustomerRelation(
        ProductListCustomerRelationTransfer $productListCustomerRelationTransfer
    ): ProductListCustomerRelationTransfer {
        return $this->getTransactionHandler()->handleTransaction(
            function () use ($productListCustomerRelationTransfer) {
                return $this->executeSaveProductListCustomerRelationTransaction($productListCustomerRelationTransfer);
            }
        );
    }
1214514
public function expandCustomerTransferWithProductListIds(CustomerTransfer $customerTransfer): CustomerTransfer
    {
        if ($this->hasCustomerTransferProductLists($customerTransfer)) {
            return $customerTransfer;
        }

        $companyUserTransfer = $customerTransfer->getCompanyUserTransfer();

        if ($companyUserTransfer === null || $companyUserTransfer->getCompany() === null) {
            return $customerTransfer;
        }

        $productListCollectionTransfer = $this->productListReader->getProductListCollectionByIdCompanyId(
            $companyUserTransfer->getCompany()
        );

        $this->addProductListsToCustomerTransfer($customerTransfer, $productListCollectionTransfer);

        return $customerTransfer;
    }