@param \Generated\Shared\Transfer\AdyenApiRequestTransfer $adyenApiRequestTransfer

@return void
966488
protected function validateRequestTransfer(AdyenApiRequestTransfer $adyenApiRequestTransfer): void
    {
        $adyenApiRequestTransfer->requireAuthorizeRequest();

        $adyenApiRequestTransfer
            ->getAuthorizeRequest()
            ->requireAmount()
            ->requireMerchantAccount()
            ->requireReference();

        $adyenApiRequestTransfer
            ->getAuthorizeRequest()
            ->getAmount()
            ->requireCurrency()
            ->requireValue();
    }
540124
public function performRefundRequest(
        OrderTransfer $orderTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): ComputopApiRefundResponseTransfer {
        return $this
            ->getFactory()
            ->createRefundPaymentRequest()
            ->request($orderTransfer, $computopApiHeaderPayment);
    }
804696
public function ajaxRedirect(string $destination, array $args = []): void
	{
		$this->payload->forceRedirect = $this->link($destination, $args);
		$this->sendPayload();
	}
167884
private function setRequest(Request $request = null)
    {
        $this->request = $request;
        $this->override = null;
    }
148347
public function requestPost(\Adyen\Service $service, $requestUrl, $params)
	{
		$client = $service->getClient();
		$config = $client->getConfig();
		$logger = $client->getLogger();
		$username = $config->getUsername();
		$password = $config->getPassword();

		// log the requestUr, params and json request
		$logger->info("Request url to Adyen: " . $requestUrl);
		$logger->info('Params in request to Adyen:' . print_r($params, 1));

		//Initiate cURL.
		$ch = curl_init($requestUrl);

		//Tell cURL that we want to send a POST request.
		curl_setopt($ch, CURLOPT_POST, 1);

		// set authorisation
		curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
		curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
		curl_setopt($ch, CURLOPT_POST, count($params));
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));

		// set a custom User-Agent
		$userAgent = $config->get('applicationName') . " " . \Adyen\Client::USER_AGENT_SUFFIX . $client->getLibraryVersion();

		//Set the content type to application/json and use the defined userAgent
		$headers = array(
			'Content-Type: application/x-www-form-urlencoded',
			'User-Agent: ' . $userAgent
		);

		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

		// return the result
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

		//Execute the request
		list($result, $httpStatus) = $this->curlRequest($ch);

		// log the raw response
		$logger->info("JSON Response is: " . $result);

		// Get errors
		list($errno, $message) = $this->curlError($ch);

		curl_close($ch);

		if ($httpStatus != 200 && $result) {
			$this->handleResultError($result, $logger);
		} elseif (!$result) {
			$this->handleCurlError($requestUrl, $errno, $message, $logger);
		}

		// result in array or json
		if ($config->getOutputType() == 'array') {
			// transform to PHP Array
			$result = json_decode($result, true);

			if (!$result) {
				$msg = "The result is empty, looks like your request is invalid";
				$logger->error($msg);
				throw new \Adyen\AdyenException($msg);
			}

			// log the array result
			$logger->info('Params in response from Adyen:' . print_r($result, 1));
		}

		return $result;
	}
46153
public function sendRequest($request)
	{
		// Check if request was passed in
		if (!$request) {
			throw new InvalidArgumentException('No data was passed into the provision request');
		}

		return $this->client->post($this->prv_url, [
			'Content-type'             => 'text/xml',
			'Content-length'           => strlen($request),
			'MMProvision-Access-Token' => $this->prv_token,
		], $request);
	}
541320
public function cancelRedirectAction(PayoneCancelRedirectTransfer $cancelRedirectTransfer)
    {
        $urlHmacGenerator = $this->getFactory()->createUrlHmacGenerator();
        $hash = $urlHmacGenerator->hash(
            $cancelRedirectTransfer->getOrderReference(),
            $this->getFactory()->getConfig()->getRequestStandardParameter()->getKey()
        );

        if ($cancelRedirectTransfer->getUrlHmac() === $hash) {
            $orderItems = SpySalesOrderItemQuery::create()
                ->useOrderQuery()
                ->filterByOrderReference($cancelRedirectTransfer->getOrderReference())
                ->endUse()
                ->find();

            $this->getFactory()->getOmsFacade()->triggerEvent('cancel redirect', $orderItems, []);
        }

        return $cancelRedirectTransfer;
    }
115857
protected function validateRequestTransfer(AdyenApiRequestTransfer $adyenApiRequestTransfer): void
    {
        $adyenApiRequestTransfer->requirePaymentMethodsRequest();

        $adyenApiRequestTransfer
            ->getPaymentMethodsRequest()
            ->requireMerchantAccount()
            ->requireChannel()
            ->requireAmount();

        $adyenApiRequestTransfer
            ->getPaymentMethodsRequest()
            ->getAmount()
            ->requireCurrency()
            ->requireValue();
    }
1117045
public function performReverseRequest(
        OrderTransfer $orderTransfer,
        ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment
    ): ComputopApiReverseResponseTransfer {
        return $this
            ->getFactory()
            ->createReversePaymentRequest()
            ->request($orderTransfer, $computopApiHeaderPayment);
    }
1260737
public function bind(AbstractAdmin $admin, Request $request)
    {
        if ($this->request) {
            throw new \RuntimeException('A datagrid can only be bound once to a request');
        }

        // configure our datagrid
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $this->options = $resolver->resolve($admin->getDatagridOptions());

        $this->admin = $admin;
        $this->request = $request;

        // attach our fields, filters and actions
        $this->admin->buildDatagrid($this);

        $this->applyFilters();
    }
390833
protected function onAuthenticationSuccess(ActionRequest $originalRequest = null)
    {
        if ($this->view instanceof JsonView) {
            $this->view->assign('value', ['success' => $this->authenticationManager->isAuthenticated(), 'csrfToken' => $this->securityContext->getCsrfProtectionToken()]);
        } else {
            if ($this->request->hasArgument('lastVisitedNode') && strlen($this->request->getArgument('lastVisitedNode')) > 0) {
                $this->session->putData('lastVisitedNode', $this->request->getArgument('lastVisitedNode'));
            }
            if ($originalRequest !== null) {
                // Redirect to the location that redirected to the login form because the user was nog logged in
                $this->redirectToRequest($originalRequest);
            }

            $this->redirect('index', 'Backend\Backend');
        }
    }
1372077
protected function setPayonePayment(Request $request, QuoteTransfer $quoteTransfer, $paymentSelection)
    {
        $payonePaymentTransfer = $this->getPayonePaymentTransfer($quoteTransfer, $paymentSelection);

        $paymentDetailTransfer = new PaymentDetailTransfer();
        // get it from quotaTransfer
        $paymentDetailTransfer->setAmount($quoteTransfer->getTotals()->getGrandTotal());
        $paymentDetailTransfer->setCurrency($this->getCurrency());
        if ($paymentSelection === PaymentTransfer::PAYONE_CREDIT_CARD) {
            $paymentDetailTransfer->setPseudoCardPan($payonePaymentTransfer->getPseudocardpan());
        } elseif ($paymentSelection === PaymentTransfer::PAYONE_E_WALLET) {
            $paymentDetailTransfer->setType($payonePaymentTransfer->getWallettype());
        } elseif ($paymentSelection === PaymentTransfer::PAYONE_DIRECT_DEBIT) {
            $paymentDetailTransfer->setBankCountry($payonePaymentTransfer->getBankcountry());
            $paymentDetailTransfer->setBankAccount($payonePaymentTransfer->getBankaccount());
            $paymentDetailTransfer->setBankCode($payonePaymentTransfer->getBankcode());
            $paymentDetailTransfer->setBic($payonePaymentTransfer->getBic());
            $paymentDetailTransfer->setIban($payonePaymentTransfer->getIban());
            $paymentDetailTransfer->setMandateIdentification($payonePaymentTransfer->getMandateIdentification());
            $paymentDetailTransfer->setMandateText($payonePaymentTransfer->getMandateText());
        } elseif ($paymentSelection === PaymentTransfer::PAYONE_EPS_ONLINE_TRANSFER
            || $paymentSelection === PaymentTransfer::PAYONE_INSTANT_ONLINE_TRANSFER
            || $paymentSelection === PaymentTransfer::PAYONE_GIROPAY_ONLINE_TRANSFER
            || $paymentSelection === PaymentTransfer::PAYONE_IDEAL_ONLINE_TRANSFER
            || $paymentSelection === PaymentTransfer::PAYONE_POSTFINANCE_EFINANCE_ONLINE_TRANSFER
            || $paymentSelection === PaymentTransfer::PAYONE_POSTFINANCE_CARD_ONLINE_TRANSFER
            || $paymentSelection === PaymentTransfer::PAYONE_PRZELEWY24_ONLINE_TRANSFER
            || $paymentSelection === PaymentTransfer::PAYONE_BANCONTACT_ONLINE_TRANSFER
        ) {
            $paymentDetailTransfer->setType($payonePaymentTransfer->getOnlineBankTransferType());
            $paymentDetailTransfer->setBankCountry($payonePaymentTransfer->getBankCountry());
            if ($paymentSelection === PaymentTransfer::PAYONE_BANCONTACT_ONLINE_TRANSFER) {
                $paymentDetailTransfer->setBankCountry($quoteTransfer->getBillingAddress()->getIso2Code());
            }
            $paymentDetailTransfer->setBankAccount($payonePaymentTransfer->getBankAccount());
            $paymentDetailTransfer->setBankCode($payonePaymentTransfer->getBankCode());
            $paymentDetailTransfer->setBankBranchCode($payonePaymentTransfer->getBankBranchCode());
            $paymentDetailTransfer->setBankCheckDigit($payonePaymentTransfer->getBankCheckDigit());
            $paymentDetailTransfer->setBankGroupType($payonePaymentTransfer->getBankGroupType());
            $paymentDetailTransfer->setIban($payonePaymentTransfer->getIban());
            $paymentDetailTransfer->setBic($payonePaymentTransfer->getBic());
        } elseif ($paymentSelection == PaymentTransfer::PAYONE_CASH_ON_DELIVERY) {
            $shippingProvider = $quoteTransfer->getShipment()->getMethod()->getCarrierName();
            $paymentDetailTransfer->setShippingProvider($shippingProvider);
        }

        $quoteTransfer->getPayment()->setPayone(new PayonePaymentTransfer());
        $quoteTransfer->getPayment()->getPayone()->setReference(uniqid('TX1'));
        $quoteTransfer->getPayment()->getPayone()->setPaymentDetail($paymentDetailTransfer);
        $quoteTransfer->getPayment()->getPayone()->setPaymentMethod($quoteTransfer->getPayment()->getPaymentMethod());
    }
125982
protected function updateResponseTransfer(AdyenApiResponseTransfer $responseTransfer, array $response): AdyenApiResponseTransfer
    {
        $apiResponseTransfer = (new AdyenApiMakePaymentResponseTransfer())->fromArray($response, true);

        return $responseTransfer->setMakePaymentResponse($apiResponseTransfer);
    }
412955
protected function beforeSend(RequestInterface $request)
    {
        try {
            $state = $request->setState(RequestInterface::STATE_TRANSFER);
            if ($state == RequestInterface::STATE_TRANSFER) {
                $this->addHandle($request);
            } else {
                // Requests might decide they don't need to be sent just before
                // transfer (e.g. CachePlugin)
                $this->remove($request);
                if ($state == RequestInterface::STATE_COMPLETE) {
                    $this->successful[] = $request;
                }
            }
        } catch (\Exception $e) {
            // Queue the exception to be thrown when sent
            $this->removeErroredRequest($request, $e);
        }
    }
732018
public function addToDataClass(Request $request, AbstractTransfer $quoteTransfer): QuoteTransfer
    {
        return $this->getFactory()->createPayoneHandler()->addPaymentToQuote($request, $quoteTransfer);
    }
1341676
protected function updateResponseTransfer(AdyenApiResponseTransfer $responseTransfer, array $response): AdyenApiResponseTransfer
    {
        $apiResponseTransfer = (new AdyenApiAdjustAuthorizationResponseTransfer())->fromArray($response, true);

        return $responseTransfer->setAdjustAuthorizationResponse($apiResponseTransfer);
    }
850881
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $request = $event->getRequest();
        $currentRoute = $request->attributes->get('_route', '');
        if (mb_stripos($currentRoute, self::ADMIN_ROUTE_PREFIX) !== 0) {
            return;
        }

        $request->attributes->set(self::ADMIN_FLAG_NAME, true);

        $adminEvent = new AdminMatchEvent($event->getRequest(), $event->getRequestType());
        $this->eventDispatcher->dispatch($adminEvent, BlockManagerAdminEvents::ADMIN_MATCH);
    }