-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented CsrfAwareActionInterface in order to process POST requests
- Loading branch information
andy
committed
May 9, 2019
1 parent
70c94a4
commit 3ede6e5
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,24 @@ | |
|
||
namespace Paynl\Payment\Controller\Checkout; | ||
|
||
use Magento\Framework\App\Request\InvalidRequestException; | ||
use Magento\Framework\App\RequestInterface; | ||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Sales\Model\Order; | ||
use Magento\Sales\Model\Order\Payment\Interceptor; | ||
use Magento\Sales\Model\OrderRepository; | ||
use Paynl\Payment\Controller\CsrfAwareActionInterface; | ||
use Paynl\Result\Transaction\Transaction; | ||
|
||
|
||
|
||
/** | ||
* Description of Index | ||
* | ||
* @author Andy Pieters <[email protected]> | ||
*/ | ||
class Exchange extends \Magento\Framework\App\Action\Action | ||
class Exchange extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface | ||
// implements CsrfAwareActionInterface | ||
{ | ||
/** | ||
* | ||
|
@@ -59,6 +65,16 @@ class Exchange extends \Magento\Framework\App\Action\Action | |
|
||
private $paynlConfig; | ||
|
||
public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Krielkip
|
||
{ | ||
return null; | ||
} | ||
|
||
public function validateForCsrf(RequestInterface $request): bool | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Exchange constructor. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Paynl\Payment\Controller; | ||
|
||
//workaround to make sure this works in magento < 2.3 | ||
|
||
if (interface_exists('\Magento\Framework\App\CsrfAwareActionInterface')) { | ||
interface CsrfAwareActionInterface extends \Magento\Framework\App\CsrfAwareActionInterface | ||
{ | ||
} | ||
} else { | ||
interface CsrfAwareActionInterface | ||
{ | ||
} | ||
} |
Repositories code generation... 1/7 [====>-----------------------] 14% 1 sec 54.0 MiBPHP Parse error: syntax error, unexpected '?' in /var/www/site/vendor/paynl/magento2-plugin/Controller/Checkout/Exchange.php on line 68