We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit ab20f519 authored by Alexandros Moraitis's avatar Alexandros Moraitis Committed by GitHub

Separate Checks IP and HMAC (#809)

* Separate Checks IP and HMAC

* Merge the if statements
parent c36a919e
......@@ -205,16 +205,16 @@ class Json extends \Magento\Framework\App\Action\Action
*/
protected function _processNotification($response, $notificationMode)
{
if ($this->configHelper->getNotificationsIpCheck()) {
//Validate if the notification comes from a verified IP
if (!$this->isIpValid()) {
//Validate if Ip check is enabled and if the notification comes from a verified IP
if ($this->configHelper->getNotificationsIpCheck() && !$this->isIpValid()) {
$this->_adyenLogger->addAdyenNotification(
"Notification has been rejected because the IP address could not be verified"
);
return false;
}
if ($this->configHelper->getNotificationsHmacCheck()) {
if ($this->hmacSignature->isHmacSupportedEventCode($response)) {
if ($this->configHelper->getNotificationsHmacCheck() && $this->hmacSignature->isHmacSupportedEventCode(
$response
)) {
//Validate the Hmac calculation
if (!$this->hmacSignature->isValidNotificationHMAC(
$this->configHelper->getNotificationsHmacKey(),
......@@ -226,8 +226,7 @@ class Json extends \Magento\Framework\App\Action\Action
return false;
}
}
}
}
// validate the notification
if ($this->authorised($response)) {
// log the notification
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment