File tree Expand file tree Collapse file tree 7 files changed +152
-7
lines changed
Authorizenet/Controller/Directpost/Payment Expand file tree Collapse file tree 7 files changed +152
-7
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Authorizenet \Model \Directpost ;
11
11
use Magento \Authorizenet \Model \DirectpostFactory ;
12
12
use Magento \Framework \App \Action \Context ;
13
+ use Magento \Framework \App \CsrfAwareActionInterface ;
14
+ use Magento \Framework \App \Request \InvalidRequestException ;
15
+ use Magento \Framework \App \RequestInterface ;
13
16
use Magento \Framework \Controller \ResultFactory ;
14
17
use Magento \Framework \Exception \LocalizedException ;
15
18
use Magento \Framework \Registry ;
16
19
use Psr \Log \LoggerInterface ;
17
20
18
- class BackendResponse extends \Magento \Authorizenet \Controller \Directpost \Payment
21
+ class BackendResponse extends \Magento \Authorizenet \Controller \Directpost \Payment implements CsrfAwareActionInterface
19
22
{
20
23
/**
21
24
* @var LoggerInterface
@@ -48,6 +51,23 @@ public function __construct(
48
51
$ this ->logger = $ logger ?: $ this ->_objectManager ->get (LoggerInterface::class);
49
52
}
50
53
54
+ /**
55
+ * @inheritDoc
56
+ */
57
+ public function createCsrfValidationException (
58
+ RequestInterface $ request
59
+ ): ?InvalidRequestException {
60
+ return null ;
61
+ }
62
+
63
+ /**
64
+ * @inheritDoc
65
+ */
66
+ public function validateForCsrf (RequestInterface $ request ): ?bool
67
+ {
68
+ return true ;
69
+ }
70
+
51
71
/**
52
72
* Response action.
53
73
* Action for Authorize.net SIM Relay Request.
Original file line number Diff line number Diff line change 6
6
*/
7
7
namespace Magento \Authorizenet \Controller \Directpost \Payment ;
8
8
9
- class Response extends \Magento \Authorizenet \Controller \Directpost \Payment
9
+ use Magento \Framework \App \CsrfAwareActionInterface ;
10
+ use Magento \Framework \App \Request \InvalidRequestException ;
11
+ use Magento \Framework \App \RequestInterface ;
12
+
13
+ class Response extends \Magento \Authorizenet \Controller \Directpost \Payment implements CsrfAwareActionInterface
10
14
{
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ public function createCsrfValidationException (
19
+ RequestInterface $ request
20
+ ): ?InvalidRequestException {
21
+ return null ;
22
+ }
23
+
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ public function validateForCsrf (RequestInterface $ request ): ?bool
28
+ {
29
+ return true ;
30
+ }
31
+
11
32
/**
12
33
* Response action.
13
34
* Action for Authorize.net SIM Relay Request.
Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \Paypal \Controller \Ipn ;
9
9
10
+ use Magento \Framework \App \CsrfAwareActionInterface ;
11
+ use Magento \Framework \App \Request \InvalidRequestException ;
12
+ use Magento \Framework \App \RequestInterface ;
10
13
use Magento \Framework \Exception \RemoteServiceUnavailableException ;
11
14
12
15
/**
13
16
* Unified IPN controller for all supported PayPal methods
14
17
*/
15
- class Index extends \Magento \Framework \App \Action \Action
18
+ class Index extends \Magento \Framework \App \Action \Action implements CsrfAwareActionInterface
16
19
{
17
20
/**
18
21
* @var \Psr\Log\LoggerInterface
@@ -39,6 +42,23 @@ public function __construct(
39
42
parent ::__construct ($ context );
40
43
}
41
44
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ public function createCsrfValidationException (
49
+ RequestInterface $ request
50
+ ): ?InvalidRequestException {
51
+ return null ;
52
+ }
53
+
54
+ /**
55
+ * @inheritDoc
56
+ */
57
+ public function validateForCsrf (RequestInterface $ request ): ?bool
58
+ {
59
+ return true ;
60
+ }
61
+
42
62
/**
43
63
* Instantiate IPN model and pass IPN request to it
44
64
*
Original file line number Diff line number Diff line change 6
6
*/
7
7
namespace Magento \Paypal \Controller \Payflow ;
8
8
9
- class CancelPayment extends \Magento \Paypal \Controller \Payflow
9
+ use Magento \Framework \App \CsrfAwareActionInterface ;
10
+ use Magento \Framework \App \Request \InvalidRequestException ;
11
+ use Magento \Framework \App \RequestInterface ;
12
+
13
+ class CancelPayment extends \Magento \Paypal \Controller \Payflow implements CsrfAwareActionInterface
10
14
{
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ public function createCsrfValidationException (
19
+ RequestInterface $ request
20
+ ): ?InvalidRequestException {
21
+ return null ;
22
+ }
23
+
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ public function validateForCsrf (RequestInterface $ request ): ?bool
28
+ {
29
+ return true ;
30
+ }
31
+
11
32
/**
12
33
* When a customer cancel payment from payflow gateway.
13
34
*
Original file line number Diff line number Diff line change 6
6
*/
7
7
namespace Magento \Paypal \Controller \Payflow ;
8
8
9
+ use Magento \Framework \App \CsrfAwareActionInterface ;
10
+ use Magento \Framework \App \Request \InvalidRequestException ;
11
+ use Magento \Framework \App \RequestInterface ;
9
12
use Magento \Paypal \Controller \Payflow ;
10
13
use Magento \Paypal \Model \Config ;
11
14
use Magento \Sales \Model \Order ;
12
15
13
- class ReturnUrl extends Payflow
16
+ class ReturnUrl extends Payflow implements CsrfAwareActionInterface
14
17
{
15
18
/**
16
19
* @var array of allowed order states on frontend
@@ -30,6 +33,23 @@ class ReturnUrl extends Payflow
30
33
Config::METHOD_PAYFLOWLINK
31
34
];
32
35
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ public function createCsrfValidationException (
40
+ RequestInterface $ request
41
+ ): ?InvalidRequestException {
42
+ return null ;
43
+ }
44
+
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ public function validateForCsrf (RequestInterface $ request ): ?bool
49
+ {
50
+ return true ;
51
+ }
52
+
33
53
/**
34
54
* When a customer return to website from payflow gateway.
35
55
*
Original file line number Diff line number Diff line change 6
6
*/
7
7
namespace Magento \Paypal \Controller \Payflow ;
8
8
9
- class SilentPost extends \Magento \Paypal \Controller \Payflow
9
+ use Magento \Framework \App \CsrfAwareActionInterface ;
10
+ use Magento \Framework \App \Request \InvalidRequestException ;
11
+ use Magento \Framework \App \RequestInterface ;
12
+
13
+ class SilentPost extends \Magento \Paypal \Controller \Payflow implements CsrfAwareActionInterface
10
14
{
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ public function createCsrfValidationException (
19
+ RequestInterface $ request
20
+ ): ?InvalidRequestException {
21
+ return null ;
22
+ }
23
+
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ public function validateForCsrf (RequestInterface $ request ): ?bool
28
+ {
29
+ return true ;
30
+ }
31
+
11
32
/**
12
33
* Get response from PayPal by silent post method
13
34
*
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Paypal \Controller \Transparent ;
7
7
8
+ use Magento \Framework \App \CsrfAwareActionInterface ;
9
+ use Magento \Framework \App \Request \InvalidRequestException ;
10
+ use Magento \Framework \App \RequestInterface ;
8
11
use Magento \Framework \Registry ;
9
12
use Magento \Framework \App \Action \Context ;
10
13
use Magento \Framework \View \Result \LayoutFactory ;
19
22
20
23
/**
21
24
* Class Response
25
+ *
26
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
22
27
*/
23
- class Response extends \Magento \Framework \App \Action \Action
28
+ class Response extends \Magento \Framework \App \Action \Action implements CsrfAwareActionInterface
24
29
{
25
30
/**
26
31
* Core registry
@@ -91,6 +96,23 @@ public function __construct(
91
96
$ this ->paymentFailures = $ paymentFailures ?: $ this ->_objectManager ->get (PaymentFailuresInterface::class);
92
97
}
93
98
99
+ /**
100
+ * @inheritDoc
101
+ */
102
+ public function createCsrfValidationException (
103
+ RequestInterface $ request
104
+ ): ?InvalidRequestException {
105
+ return null ;
106
+ }
107
+
108
+ /**
109
+ * @inheritDoc
110
+ */
111
+ public function validateForCsrf (RequestInterface $ request ): ?bool
112
+ {
113
+ return true ;
114
+ }
115
+
94
116
/**
95
117
* @return ResultInterface
96
118
*/
You can’t perform that action at this time.
0 commit comments