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 1010use Magento \Authorizenet \Model \Directpost ;
1111use Magento \Authorizenet \Model \DirectpostFactory ;
1212use Magento \Framework \App \Action \Context ;
13+ use Magento \Framework \App \CsrfAwareActionInterface ;
14+ use Magento \Framework \App \Request \InvalidRequestException ;
15+ use Magento \Framework \App \RequestInterface ;
1316use Magento \Framework \Controller \ResultFactory ;
1417use Magento \Framework \Exception \LocalizedException ;
1518use Magento \Framework \Registry ;
1619use Psr \Log \LoggerInterface ;
1720
18- class BackendResponse extends \Magento \Authorizenet \Controller \Directpost \Payment
21+ class BackendResponse extends \Magento \Authorizenet \Controller \Directpost \Payment implements CsrfAwareActionInterface
1922{
2023 /**
2124 * @var LoggerInterface
@@ -48,6 +51,23 @@ public function __construct(
4851 $ this ->logger = $ logger ?: $ this ->_objectManager ->get (LoggerInterface::class);
4952 }
5053
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+
5171 /**
5272 * Response action.
5373 * Action for Authorize.net SIM Relay Request.
Original file line number Diff line number Diff line change 66 */
77namespace Magento \Authorizenet \Controller \Directpost \Payment ;
88
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
1014{
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+
1132 /**
1233 * Response action.
1334 * Action for Authorize.net SIM Relay Request.
Original file line number Diff line number Diff line change 77
88namespace Magento \Paypal \Controller \Ipn ;
99
10+ use Magento \Framework \App \CsrfAwareActionInterface ;
11+ use Magento \Framework \App \Request \InvalidRequestException ;
12+ use Magento \Framework \App \RequestInterface ;
1013use Magento \Framework \Exception \RemoteServiceUnavailableException ;
1114
1215/**
1316 * Unified IPN controller for all supported PayPal methods
1417 */
15- class Index extends \Magento \Framework \App \Action \Action
18+ class Index extends \Magento \Framework \App \Action \Action implements CsrfAwareActionInterface
1619{
1720 /**
1821 * @var \Psr\Log\LoggerInterface
@@ -39,6 +42,23 @@ public function __construct(
3942 parent ::__construct ($ context );
4043 }
4144
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+
4262 /**
4363 * Instantiate IPN model and pass IPN request to it
4464 *
Original file line number Diff line number Diff line change 66 */
77namespace Magento \Paypal \Controller \Payflow ;
88
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
1014{
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+
1132 /**
1233 * When a customer cancel payment from payflow gateway.
1334 *
Original file line number Diff line number Diff line change 66 */
77namespace Magento \Paypal \Controller \Payflow ;
88
9+ use Magento \Framework \App \CsrfAwareActionInterface ;
10+ use Magento \Framework \App \Request \InvalidRequestException ;
11+ use Magento \Framework \App \RequestInterface ;
912use Magento \Paypal \Controller \Payflow ;
1013use Magento \Paypal \Model \Config ;
1114use Magento \Sales \Model \Order ;
1215
13- class ReturnUrl extends Payflow
16+ class ReturnUrl extends Payflow implements CsrfAwareActionInterface
1417{
1518 /**
1619 * @var array of allowed order states on frontend
@@ -30,6 +33,23 @@ class ReturnUrl extends Payflow
3033 Config::METHOD_PAYFLOWLINK
3134 ];
3235
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+
3353 /**
3454 * When a customer return to website from payflow gateway.
3555 *
Original file line number Diff line number Diff line change 66 */
77namespace Magento \Paypal \Controller \Payflow ;
88
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
1014{
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+
1132 /**
1233 * Get response from PayPal by silent post method
1334 *
Original file line number Diff line number Diff line change 55 */
66namespace Magento \Paypal \Controller \Transparent ;
77
8+ use Magento \Framework \App \CsrfAwareActionInterface ;
9+ use Magento \Framework \App \Request \InvalidRequestException ;
10+ use Magento \Framework \App \RequestInterface ;
811use Magento \Framework \Registry ;
912use Magento \Framework \App \Action \Context ;
1013use Magento \Framework \View \Result \LayoutFactory ;
1922
2023/**
2124 * Class Response
25+ *
26+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2227 */
23- class Response extends \Magento \Framework \App \Action \Action
28+ class Response extends \Magento \Framework \App \Action \Action implements CsrfAwareActionInterface
2429{
2530 /**
2631 * Core registry
@@ -91,6 +96,23 @@ public function __construct(
9196 $ this ->paymentFailures = $ paymentFailures ?: $ this ->_objectManager ->get (PaymentFailuresInterface::class);
9297 }
9398
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+
94116 /**
95117 * @return ResultInterface
96118 */
You can’t perform that action at this time.
0 commit comments