Skip to content

Commit

Permalink
Moved reasonCode checking before signature checking
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdnepr committed Jul 3, 2019
1 parent 2f26232 commit e96be0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Request/ApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ abstract public function getResponseClass();
*/
public function getResponse(array $data)
{
$class = $this->getResponseClass();
$response = new $class($data);

if ($signatureRequired = $this->getResponseSignatureFieldsRequired()) {
$expected = $this->getSignature(
$signatureRequired,
Expand All @@ -154,8 +157,7 @@ public function getResponse(array $data)
}
}

$class = $this->getResponseClass();
return new $class($data);
return $response;
}

/**
Expand Down

0 comments on commit e96be0b

Please sign in to comment.