@param \Generated\Shared\Transfer\AdyenApiResponseTransfer $responseTransfer
@param array $response

@return \Generated\Shared\Transfer\AdyenApiResponseTransfer
548465
protected function updateResponseTransfer(AdyenApiResponseTransfer $responseTransfer, array $response): AdyenApiResponseTransfer
    {
        $apiResponseTransfer = (new AdyenApiAuthorize3dResponseTransfer())->fromArray($response, true);

        return $responseTransfer->setAuthorize3dResponse($apiResponseTransfer);
    }
599123
public function getCaptureResponseTransfer(CaptureResponseContainer $responseContainer)
    {
        $result = new CaptureResponseTransfer();
        $clearing = new ClearingTransfer();
        $creditor = new CreditorTransfer();
        $baseResponse = new BaseResponseTransfer();

        // Fill clearing transfer
        $clearing->setBankAccountHolder($responseContainer->getClearingBankaccountholder());
        $clearing->setBankCountry($responseContainer->getClearingBankcountry());
        $clearing->setBankAccount($responseContainer->getClearingBankaccount());
        $clearing->setBankCode($responseContainer->getClearingBankcode());
        $clearing->setBankIban($responseContainer->getClearingBankiban());
        $clearing->setBankBic($responseContainer->getClearingBankbic());
        $clearing->setBankCity($responseContainer->getClearingBankcity());
        $clearing->setBankName($responseContainer->getClearingBankname());
        $clearing->setLegalNote($responseContainer->getClearingLegalnote());
        $clearing->setDate($responseContainer->getClearingDate());
        $clearing->setDueDate($responseContainer->getClearingDuedate());
        $clearing->setReference($responseContainer->getClearingReference());
        $clearing->setInstructionNote($responseContainer->getClearingInstructionnote());
        $clearing->setAmount($responseContainer->getClearingAmount());

        // Fill creditor transfer
        $creditor->setIdentifier($responseContainer->getCreditorIdentifier());
        $creditor->setName($responseContainer->getCreditorName());
        $creditor->setStreet($responseContainer->getCreditorStreet());
        $creditor->setZip($responseContainer->getCreditorZip());
        $creditor->setCity($responseContainer->getCreditorCity());
        $creditor->setCountry($responseContainer->getCreditorCountry());
        $creditor->setEmail($responseContainer->getCreditorEmail());

        // Fill base response transfer
        $baseResponse->setErrorCode($responseContainer->getErrorcode());
        $baseResponse->setErrorMessage($responseContainer->getErrormessage());
        $baseResponse->setCustomerMessage($responseContainer->getCustomermessage());
        $baseResponse->setStatus($responseContainer->getStatus());
        $baseResponse->setRawResponse($responseContainer->getRawResponse());

        // Set plain attributes
        $result->setTxid($responseContainer->getTxid());
        $result->setSettleAccount($responseContainer->getSettleaccount());
        $result->setMandateIdentification($responseContainer->getMandateIdentification());

        // Set aggregated transfers
        $result->setClearing($clearing);
        $result->setCreditor($creditor);
        $result->setBaseResponse($baseResponse);

        return $result;
    }
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;
    }
395187
public function send(DispatcherResponseInterface $response)
    {
        if($response->isDownloadable())
        {
            $server = strtolower($_SERVER['SERVER_SOFTWARE']);

            //Apache
            if(strpos($server, 'apache') !== FALSE)
            {
                if(in_array('mod_xsendfile', apache_get_modules()))
                {
                    $path = $response->getStream()->getPath();

                    $response->headers->set('X-Sendfile', $path);
                    return parent::send($response);
                }
            }

            //Nginx
            if(strpos($server, 'nginx') !== FALSE)
            {
                $path = $response->getStream()->getPath();
                $path = preg_replace('/'.preg_quote(\Kodekit::getInstance()->getRootPath(), '/').'/', '', $path, 1);

                $response->headers->set('X-Accel-Redirect' , $path);
                return parent::send($response);
            }
        }
    }
149866
public static function fromResponse(ResponseInterface $response)
    {
        $name = $response->getHeaderLine('X-Endpoint');
        
        if (! isset(BaseApi::$endpointDefinitions[$name])) {
            throw new \InvalidArgumentException('Could not resolve Endpoint from the provided response: \n'.$response->getBody()->__toString());
        }

        /** @var BaseEndpoint $endpointClass */
        $endpointClass = BaseApi::$endpointDefinitions[$name]['class'];

        return new $endpointClass(Region::create($response->getHeaderLine('X-Region')));
    }
177699
protected function updateResponseTransfer(AdyenApiResponseTransfer $responseTransfer, array $response): AdyenApiResponseTransfer
    {
        $apiResponseTransfer = (new AdyenApiPaymentDetailsResponseTransfer())->fromArray($response, true);

        return $responseTransfer->setPaymentDetailsResponse($apiResponseTransfer);
    }
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;
    }
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;
    }
206927
protected function setPaynetId(PaymentTransaction $paymentTransaction, Response $response)
    {
        $responsePaynetId = $response->getPaymentPaynetId();

        if(strlen($responsePaynetId) > 0)
        {
            $paymentTransaction
                ->getPayment()
                ->setPaynetId($responsePaynetId)
            ;
        }
    }
144790
public function httpMove(RequestInterface $request, ResponseInterface $response)
    {
        $path = $request->getPath();

        $moveInfo = $this->server->getCopyAndMoveInfo($request);

        if ($moveInfo['destinationExists']) {
            if (!$this->server->emit('beforeUnbind', [$moveInfo['destination']])) {
                return false;
            }
        }
        if (!$this->server->emit('beforeUnbind', [$path])) {
            return false;
        }
        if (!$this->server->emit('beforeBind', [$moveInfo['destination']])) {
            return false;
        }
        if (!$this->server->emit('beforeMove', [$path, $moveInfo['destination']])) {
            return false;
        }

        if ($moveInfo['destinationExists']) {
            $this->server->tree->delete($moveInfo['destination']);
            $this->server->emit('afterUnbind', [$moveInfo['destination']]);
        }

        $this->server->tree->move($path, $moveInfo['destination']);

        // Its important afterMove is called before afterUnbind, because it
        // allows systems to transfer data from one path to another.
        // PropertyStorage uses this. If afterUnbind was first, it would clean
        // up all the properties before it has a chance.
        $this->server->emit('afterMove', [$path, $moveInfo['destination']]);
        $this->server->emit('afterUnbind', [$path]);
        $this->server->emit('afterBind', [$moveInfo['destination']]);

        // If a resource was overwritten we should send a 204, otherwise a 201
        $response->setHeader('Content-Length', '0');
        $response->setStatus($moveInfo['destinationExists'] ? 204 : 201);

        // Sending back false will interrupt the event chain and tell the server
        // we've handled this method.
        return false;
    }
1234857
static public function arrayTransfer(array $a, array $b)
	{
		if (ArrayUtils::isList($b, ArrayUtils::isList($a)))
		{
			$a = $b;
		}
		else
		{
			foreach ($b as $key => $value)
			{
				if (array_key_exists($key, $a) && is_array($value) && is_array($a[$key]))
				{
					$a[$key] = self::arrayTransfer($a[$key], $value);
				}
				else
				{
					$a[$key] = $value;
				}
			}
		}
		return $a;
	}
1236395
protected function validateRequestTransfer(AdyenApiRequestTransfer $adyenApiRequestTransfer): void
    {
        $adyenApiRequestTransfer->requireMakePaymentRequest();

        $adyenApiRequestTransfer
            ->getMakePaymentRequest()
            ->requireMerchantAccount()
            ->requireReference()
            ->requireAmount()
            ->requirePaymentMethod()
            ->requireReturnUrl();

        $adyenApiRequestTransfer
            ->getMakePaymentRequest()
            ->getAmount()
            ->requireCurrency()
            ->requireValue();
    }
237233
private function fromPsrResponse(ResponseInterface $response)
    {
        return new Response(
            $response->getStatusCode(),
            $response->getHeaders(),
            $response->getBody(),
            $response->getProtocolVersion(),
            $response->getReasonPhrase()
        );
    }
235694
protected function validateRequestTransfer(AdyenApiRequestTransfer $adyenApiRequestTransfer): void
    {
        $adyenApiRequestTransfer->requireRefundRequest();

        $adyenApiRequestTransfer
            ->getRefundRequest()
            ->requireModificationAmount()
            ->requireMerchantAccount()
            ->requireOriginalReference();

        $adyenApiRequestTransfer
            ->getRefundRequest()
            ->getModificationAmount()
            ->requireCurrency()
            ->requireValue();
    }
162918
public function performAuthorizationRequest(
        OrderTransfer $orderTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): ComputopApiAuthorizeResponseTransfer {
        return $this
            ->getFactory()
            ->createAuthorizationPaymentRequest()
            ->request($orderTransfer, $computopApiHeaderPayment);
    }
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;
    }
851850
protected function sendRequest(RequestInterface $request, $responseClass)
    {
        if (!in_array(ApiResponseInterface::class, class_implements($responseClass))) {
            throw new \InvalidArgumentException('The response class must implement "'.ApiResponseInterface::class.'".');
        }

        $body = $this->serializer->serialize($request, 'json');
        $response = $this->transport->sendRequest($body);

        /** @var ApiResponseInterface $apiResponse */
        $apiResponse = $this->serializer->deserialize($response, $responseClass, 'json');
        if ($apiResponse->getResponse() !== null && $apiResponse->getResponse()->hasErrors()) {
            throw new ApiResponseException(
                sprintf('Error calling "%s"', $request->getService()),
                $apiResponse->getResponse()->getErrors()
            );
        }

        return $apiResponse;
    }