|
5 | 5 | */
|
6 | 6 | namespace Magento\Paypal\Controller\Adminhtml\Transparent;
|
7 | 7 |
|
8 |
| -use Magento\Backend\App\AbstractAction; |
9 |
| -use Magento\Backend\App\Action\Context; |
10 |
| -use Magento\Framework\App\Action\HttpPostActionInterface; |
11 |
| -use Magento\Framework\App\CsrfAwareActionInterface; |
12 |
| -use Magento\Framework\App\Request\InvalidRequestException; |
13 |
| -use Magento\Framework\App\RequestInterface; |
14 |
| -use Magento\Framework\View\Result\LayoutFactory; |
15 |
| -use Magento\Payment\Model\Method\Logger; |
16 |
| -use Magento\Paypal\Model\Payflow\Transparent; |
17 |
| - |
18 | 8 | /**
|
19 | 9 | * Class for redirecting the Paypal response result to Magento controller.
|
20 | 10 | */
|
21 |
| -class Redirect extends AbstractAction implements HttpPostActionInterface, CsrfAwareActionInterface |
| 11 | +class Redirect extends \Magento\Paypal\Controller\Transparent\Redirect |
22 | 12 | {
|
23 |
| - /** |
24 |
| - * @var LayoutFactory |
25 |
| - */ |
26 |
| - private $resultLayoutFactory; |
27 |
| - |
28 |
| - /** |
29 |
| - * @var Transparent |
30 |
| - */ |
31 |
| - private $transparent; |
32 |
| - |
33 |
| - /** |
34 |
| - * @var Logger |
35 |
| - */ |
36 |
| - private $logger; |
37 |
| - |
38 |
| - /** |
39 |
| - * @param Context $context |
40 |
| - * @param LayoutFactory $resultLayoutFactory |
41 |
| - * @param Transparent $transparent |
42 |
| - * @param Logger $logger |
43 |
| - */ |
44 |
| - public function __construct( |
45 |
| - Context $context, |
46 |
| - LayoutFactory $resultLayoutFactory, |
47 |
| - Transparent $transparent, |
48 |
| - Logger $logger |
49 |
| - ) { |
50 |
| - parent::__construct($context); |
51 |
| - $this->transparent = $transparent; |
52 |
| - $this->logger = $logger; |
53 |
| - $this->resultLayoutFactory = $resultLayoutFactory; |
54 |
| - } |
55 |
| - |
56 |
| - /** |
57 |
| - * @inheritdoc |
58 |
| - */ |
59 |
| - public function execute() |
60 |
| - { |
61 |
| - $gatewayResponse = (array)$this->getRequest()->getPostValue(); |
62 |
| - $this->logger->debug( |
63 |
| - ['PayPal PayflowPro redirect:' => $gatewayResponse], |
64 |
| - $this->transparent->getDebugReplacePrivateDataKeys(), |
65 |
| - $this->transparent->getDebugFlag() |
66 |
| - ); |
67 |
| - |
68 |
| - $resultLayout = $this->resultLayoutFactory->create(); |
69 |
| - $resultLayout->addDefaultHandle(); |
70 |
| - $resultLayout->getLayout()->getUpdate()->load(['transparent_payment_redirect']); |
71 |
| - |
72 |
| - return $resultLayout; |
73 |
| - } |
74 |
| - |
75 |
| - /** |
76 |
| - * @inheritdoc |
77 |
| - */ |
78 |
| - public function createCsrfValidationException( |
79 |
| - RequestInterface $request |
80 |
| - ): ?InvalidRequestException { |
81 |
| - return null; |
82 |
| - } |
83 |
| - |
84 |
| - /** |
85 |
| - * @inheritdoc |
86 |
| - */ |
87 |
| - public function validateForCsrf(RequestInterface $request): ?bool |
88 |
| - { |
89 |
| - return true; |
90 |
| - } |
91 | 13 | }
|
0 commit comments