5
5
*/
6
6
namespace Magento \Paypal \Controller \Transparent ;
7
7
8
+ use Magento \Framework \App \Action \Action ;
9
+ use Magento \Framework \App \Action \Context ;
8
10
use Magento \Framework \App \Action \HttpPostActionInterface ;
9
- use Magento \Framework \App \ActionInterface ;
10
11
use Magento \Framework \App \CsrfAwareActionInterface ;
11
12
use Magento \Framework \App \Request \InvalidRequestException ;
12
13
use Magento \Framework \App \RequestInterface ;
19
20
/**
20
21
* Class for redirecting the Paypal response result to Magento controller.
21
22
*/
22
- class Redirect implements ActionInterface, CsrfAwareActionInterface, HttpPostActionInterface
23
+ class Redirect extends Action implements CsrfAwareActionInterface, HttpPostActionInterface
23
24
{
24
- /**
25
- * @var RequestInterface
26
- */
27
- private $ request ;
28
-
29
25
/**
30
26
* @var LayoutFactory
31
27
*/
@@ -42,27 +38,26 @@ class Redirect implements ActionInterface, CsrfAwareActionInterface, HttpPostAct
42
38
private $ logger ;
43
39
44
40
/**
45
- * Constructor
46
- *
47
- * @param RequestInterface $request
41
+ * @param Context $context
48
42
* @param LayoutFactory $resultLayoutFactory
49
43
* @param Transparent $transparent
50
44
* @param Logger $logger
51
45
*/
52
46
public function __construct (
53
- RequestInterface $ request ,
47
+ Context $ context ,
54
48
LayoutFactory $ resultLayoutFactory ,
55
49
Transparent $ transparent ,
56
50
Logger $ logger
57
51
) {
58
- $ this ->request = $ request ;
59
52
$ this ->resultLayoutFactory = $ resultLayoutFactory ;
60
53
$ this ->transparent = $ transparent ;
61
54
$ this ->logger = $ logger ;
55
+
56
+ parent ::__construct ($ context );
62
57
}
63
58
64
59
/**
65
- * @inheritDoc
60
+ * @inheritdoc
66
61
*/
67
62
public function createCsrfValidationException (
68
63
RequestInterface $ request
@@ -71,7 +66,7 @@ public function createCsrfValidationException(
71
66
}
72
67
73
68
/**
74
- * @inheritDoc
69
+ * @inheritdoc
75
70
*/
76
71
public function validateForCsrf (RequestInterface $ request ): ?bool
77
72
{
@@ -86,7 +81,7 @@ public function validateForCsrf(RequestInterface $request): ?bool
86
81
*/
87
82
public function execute ()
88
83
{
89
- $ gatewayResponse = (array )$ this ->request ->getPostValue ();
84
+ $ gatewayResponse = (array )$ this ->getRequest () ->getPostValue ();
90
85
$ this ->logger ->debug (
91
86
['PayPal PayflowPro redirect: ' => $ gatewayResponse ],
92
87
$ this ->transparent ->getDebugReplacePrivateDataKeys (),
0 commit comments