Skip to content

Commit 6c5d6f0

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-93786: Payment APIs webhooks are now expecting a form key
1 parent 1cb231d commit 6c5d6f0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/internal/Magento/Framework/App/FrontController.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\Exception\NotFoundException;
1414
use Magento\Framework\Message\ManagerInterface as MessageManager;
1515
use Magento\Framework\App\Action\AbstractAction;
16+
use Psr\Log\LoggerInterface;
1617

1718
/**
1819
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -39,24 +40,33 @@ class FrontController implements FrontControllerInterface
3940
*/
4041
private $messages;
4142

43+
/**
44+
* @var LoggerInterface
45+
*/
46+
private $logger;
47+
4248
/**
4349
* @param RouterListInterface $routerList
4450
* @param ResponseInterface $response
4551
* @param RequestValidator|null $requestValidator
4652
* @param MessageManager|null $messageManager
53+
* @param LoggerInterface|null $logger
4754
*/
4855
public function __construct(
4956
RouterListInterface $routerList,
5057
ResponseInterface $response,
5158
?RequestValidator $requestValidator = null,
52-
?MessageManager $messageManager = null
59+
?MessageManager $messageManager = null,
60+
?LoggerInterface $logger = null
5361
) {
5462
$this->_routerList = $routerList;
5563
$this->response = $response;
5664
$this->requestValidator = $requestValidator
5765
?? ObjectManager::getInstance()->get(RequestValidator::class);
5866
$this->messages = $messageManager
5967
?? ObjectManager::getInstance()->get(MessageManager::class);
68+
$this->logger = $logger
69+
?? ObjectManager::getInstance()->get(LoggerInterface::class);
6070
}
6171

6272
/**
@@ -125,6 +135,10 @@ private function processRequest(
125135
}
126136
} catch (InvalidRequestException $exception) {
127137
//Validation failed - processing validation results.
138+
$this->logger->debug(
139+
'Request validation failed for action "'
140+
.get_class($actionInstance) .'"'
141+
);
128142
$result = $exception->getReplaceResult();
129143
if ($messages = $exception->getMessages()) {
130144
foreach ($messages as $message) {

0 commit comments

Comments
 (0)