File tree Expand file tree Collapse file tree 2 files changed +55
-4
lines changed
app/code/Magento/Paypal/Controller/Hostedpro Expand file tree Collapse file tree 2 files changed +55
-4
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © Magento, Inc. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
6
+ declare (strict_types=1 );
7
+
7
8
namespace Magento \Paypal \Controller \Hostedpro ;
8
9
10
+ use Magento \Framework \App \Action \Action ;
9
11
use Magento \Framework \App \Action \Context ;
12
+ use Magento \Framework \App \Action \HttpGetActionInterface ;
13
+ use Magento \Framework \App \CsrfAwareActionInterface ;
14
+ use Magento \Framework \App \Request \InvalidRequestException ;
15
+ use Magento \Framework \App \RequestInterface ;
10
16
use Magento \Paypal \Helper \Checkout ;
11
17
12
- class Cancel extends \Magento \Framework \App \Action \Action
18
+ /**
19
+ * PayPal Hostedpro cancel controller.
20
+ */
21
+ class Cancel extends Action implements CsrfAwareActionInterface, HttpGetActionInterface
13
22
{
14
23
/**
15
24
* @var Checkout
@@ -40,4 +49,20 @@ public function execute()
40
49
41
50
$ this ->_redirect ('checkout ' , ['_fragment ' => 'payment ' ]);
42
51
}
52
+
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ public function createCsrfValidationException (RequestInterface $ request ): ?InvalidRequestException
57
+ {
58
+ return null ;
59
+ }
60
+
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ public function validateForCsrf (RequestInterface $ request ): ?bool
65
+ {
66
+ return true ;
67
+ }
43
68
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © Magento, Inc. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
6
+ declare (strict_types=1 );
7
+
7
8
namespace Magento \Paypal \Controller \Hostedpro ;
8
9
9
- class ReturnAction extends \Magento \Framework \App \Action \Action
10
+ use Magento \Framework \App \Action \Action ;
11
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
12
+ use Magento \Framework \App \CsrfAwareActionInterface ;
13
+ use Magento \Framework \App \Request \InvalidRequestException ;
14
+ use Magento \Framework \App \RequestInterface ;
15
+
16
+ /**
17
+ * PayPal Hostedpro return controller.
18
+ */
19
+ class ReturnAction extends Action implements CsrfAwareActionInterface, HttpPostActionInterface
10
20
{
11
21
/**
12
22
* When a customer return to website from gateway.
@@ -21,4 +31,20 @@ public function execute()
21
31
$ this ->_redirect ('checkout/onepage/success ' );
22
32
}
23
33
}
34
+
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ public function createCsrfValidationException (RequestInterface $ request ): ?InvalidRequestException
39
+ {
40
+ return null ;
41
+ }
42
+
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ public function validateForCsrf (RequestInterface $ request ): ?bool
47
+ {
48
+ return true ;
49
+ }
24
50
}
You can’t perform that action at this time.
0 commit comments