Skip to content

Commit bbe554d

Browse files
committed
Merge pull request #16 from Perfect-Web/patch-5
Update HttpRequestVerifier.php
2 parents 843aa1b + 2a8fb1b commit bbe554d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Payum/PayumModule/Security/HttpRequestVerifier.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ public function __construct(StorageInterface $tokenStorage)
2626
/**
2727
* {@inheritDoc}
2828
*/
29-
public function verify($httpRequest)
29+
public function verify($controller)
3030
{
31+
32+
$httpRequest = $controller->getRequest();
33+
3134
if (false == $httpRequest instanceof Request) {
3235
throw new InvalidArgumentException(sprintf(
3336
'Invalid request given. Expected %s but it is %s',
@@ -36,8 +39,10 @@ public function verify($httpRequest)
3639
));
3740
}
3841

42+
$hash = $controller->params()->fromRoute('payum_token') ?: $httpRequest->getQuery('payum_token');
43+
3944
/** @var $httpRequest Request */
40-
if (false === $hash = $httpRequest->getQuery('payum_token')) {
45+
if (!$hash) {
4146
//TODO we should set 404 to response but I do not know how. symfony just throws not found exception.
4247
throw new InvalidArgumentException('Token parameter not set in request');
4348
}
@@ -70,4 +75,4 @@ public function invalidate(TokenInterface $token)
7075
{
7176
$this->tokenStorage->delete($token);
7277
}
73-
}
78+
}

0 commit comments

Comments
 (0)