coreRegistry = $coreRegistry; $this->transaction = $transaction; $this->responseValidator = $responseValidator; $this->resultLayoutFactory = $resultLayoutFactory; $this->transparent = $transparent; $this->sessionTransparent = $sessionTransparent ?: $this->_objectManager->get(Session::class); $this->paymentFailures = $paymentFailures ?: $this->_objectManager->get(PaymentFailuresInterface::class); } /** * @inheritDoc */ public function createCsrfValidationException( RequestInterface $request ): ?InvalidRequestException { return null; } /** * @inheritDoc */ public function validateForCsrf(RequestInterface $request): ?bool { return true; } /** * @return ResultInterface */ public function execute() { $parameters = []; try { $response = $this->transaction->getResponseObject($this->getRequest()->getPostValue()); $this->responseValidator->validate($response, $this->transparent); $this->transaction->savePaymentInQuote($response); } catch (LocalizedException $exception) { $parameters['error'] = true; $parameters['error_msg'] = $exception->getMessage(); $this->paymentFailures->handle((int)$this->sessionTransparent->getQuoteId(), $parameters['error_msg']); } $this->coreRegistry->register(Iframe::REGISTRY_KEY, $parameters); $resultLayout = $this->resultLayoutFactory->create(); $resultLayout->addDefaultHandle(); $resultLayout->getLayout()->getUpdate()->load(['transparent_payment_response']); return $resultLayout; } }