Skip to content

Commit

Permalink
Merge pull request #2 from mSprunskas/master
Browse files Browse the repository at this point in the history
Fixes mac calculation
  • Loading branch information
mariusbalcytis authored Jun 14, 2017
2 parents 55ddc95 + e771275 commit 5f3c861
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Client/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function createRequestWithParameters($method, $uri, array $parameters = n

if ($parameters !== null) {
if ($method === RequestMethodInterface::METHOD_GET) {
$uri = $request->getUri()->withQuery(\GuzzleHttp\Psr7\build_query($parameters));
$uri = $request->getUri()->withQuery(http_build_query($parameters));
$request = $request->withUri($uri);
} else {
$data = \GuzzleHttp\json_encode($parameters);
Expand Down
3 changes: 2 additions & 1 deletion src/Middleware/Authentication/MacAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Paysera\Component\RestClientCommon\Middleware\Authentication;

use GuzzleHttp\Psr7\Uri;
use Paysera\Component\RestClientCommon\Exception\AuthenticationConfigurationException;
use Paysera\Component\RestClientCommon\Util\ConfigHandler;
use Psr\Http\Message\RequestInterface;
Expand Down Expand Up @@ -98,7 +99,7 @@ private function calculateMac(RequestInterface $request, $timestamp, $nonce, $ex
$timestamp,
$nonce,
$request->getMethod(),
$request->getUri()->getPath(),
Uri::composeComponents(null, null, $request->getUri()->getPath(), $request->getUri()->getQuery(), null),
$request->getUri()->getHost(),
$request->getUri()->getPort() !== null
? $request->getUri()->getPort()
Expand Down

0 comments on commit 5f3c861

Please sign in to comment.