Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Adyen Magento2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared Libs
Adyen Magento2
Commits
ab20f519
Commit
ab20f519
authored
Sep 09, 2020
by
Alexandros Moraitis
Committed by
GitHub
Sep 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate Checks IP and HMAC (#809)
* Separate Checks IP and HMAC * Merge the if statements
parent
c36a919e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
Controller/Process/Json.php
Controller/Process/Json.php
+17
-18
No files found.
Controller/Process/Json.php
View file @
ab20f519
...
...
@@ -205,29 +205,28 @@ 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
()
&&
$this
->
hmacSignature
->
isHmacSupportedEventCode
(
$response
))
{
//Validate the Hmac calculation
if
(
!
$this
->
hmacSignature
->
isValidNotificationHMAC
(
$this
->
configHelper
->
getNotificationsHmacKey
(),
$response
))
{
$this
->
_adyenLogger
->
addAdyenNotification
(
"Notification has been rejected because the IP address could not be verified"
'HMAC key validation failed '
.
print_r
(
$response
,
1
)
);
return
false
;
}
if
(
$this
->
configHelper
->
getNotificationsHmacCheck
())
{
if
(
$this
->
hmacSignature
->
isHmacSupportedEventCode
(
$response
))
{
//Validate the Hmac calculation
if
(
!
$this
->
hmacSignature
->
isValidNotificationHMAC
(
$this
->
configHelper
->
getNotificationsHmacKey
(),
$response
))
{
$this
->
_adyenLogger
->
addAdyenNotification
(
'HMAC key validation failed '
.
print_r
(
$response
,
1
)
);
return
false
;
}
}
}
}
// validate the notification
if
(
$this
->
authorised
(
$response
))
{
// log the notification
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment