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
bc071ac6
Commit
bc071ac6
authored
Nov 26, 2018
by
attilak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle response from Checkout API redirect
parent
c87b795e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
25 deletions
+20
-25
Controller/Process/Result.php
Controller/Process/Result.php
+20
-25
No files found.
Controller/Process/Result.php
View file @
bc071ac6
...
...
@@ -87,7 +87,6 @@ class Result extends \Magento\Framework\App\Action\Action
$this
->
_orderHistoryFactory
=
$orderHistoryFactory
;
$this
->
_session
=
$session
;
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
storeManager
=
$storeManager
;
parent
::
__construct
(
$context
);
}
...
...
@@ -302,37 +301,33 @@ class Result extends \Magento\Framework\App\Action\Action
protected
function
_authenticate
(
$response
)
{
if
(
!
empty
(
$response
[
'merchantSig'
]))
{
$merchantSigNotification
=
$response
[
'merchantSig'
];
$merchantSigNotification
=
$response
[
'merchantSig'
];
// do it like this because $_GET is converting dot to underscore
$queryString
=
$_SERVER
[
'QUERY_STRING'
];
$result
=
[];
$pairs
=
explode
(
"&"
,
$queryString
);
// do it like this because $_GET is converting dot to underscore
$queryString
=
$_SERVER
[
'QUERY_STRING'
];
$result
=
[];
$pairs
=
explode
(
"&"
,
$queryString
);
foreach
(
$pairs
as
$pair
)
{
$nv
=
explode
(
"="
,
$pair
);
$name
=
urldecode
(
$nv
[
0
]);
$value
=
urldecode
(
$nv
[
1
]);
$result
[
$name
]
=
$value
;
}
foreach
(
$pairs
as
$pair
)
{
$nv
=
explode
(
"="
,
$pair
);
$name
=
urldecode
(
$nv
[
0
]);
$value
=
urldecode
(
$nv
[
1
]);
$result
[
$name
]
=
$value
;
}
// do not include the merchantSig in the merchantSig calculation
unset
(
$result
[
'merchantSig'
]);
// do not include the merchantSig in the merchantSig calculation
unset
(
$result
[
'merchantSig'
]);
// Sign request using secret key
$hmacKey
=
$this
->
_adyenHelper
->
getHmac
();
$merchantSig
=
\Adyen\Util\Util
::
calculateSha256Signature
(
$hmacKey
,
$result
);
if
(
strcmp
(
$merchantSig
,
$merchantSigNotification
)
===
0
)
{
return
true
;
}
return
false
;
}
else
{
// send the payload verification payment\details request to validate the response
// Sign request using secret key
$hmacKey
=
$this
->
_adyenHelper
->
getHmac
();
$merchantSig
=
\Adyen\Util\Util
::
calculateSha256Signature
(
$hmacKey
,
$result
);
if
(
strcmp
(
$merchantSig
,
$merchantSigNotification
)
===
0
)
{
return
true
;
}
return
false
;
}
/**
...
...
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