Skip to content

Commit

Permalink
Merge pull request #5 from coatesap/master
Browse files Browse the repository at this point in the history
Fixes to callback
  • Loading branch information
Andrew Coates committed Feb 27, 2015
2 parents 25db54d + 9b50ce6 commit 74b45d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getData()

// Calculate the SHA and verify if it is a legitimate request
if ($this->getShaOut() && array_key_exists('SHASIGN', $requestData)) {
$barclaysSha = (string) $requestData['SHASIGN'];
$barclaysSha = (string)$requestData['SHASIGN'];
unset($requestData['SHASIGN']);

$ourSha = $this->calculateSha($this->cleanParameters($requestData), $this->getShaOut());
Expand All @@ -31,11 +31,17 @@ public function getData()

public function getRequestData()
{
if ($this->getCallbackMethod() == 'POST') {
return $this->httpRequest->request->all();
$data = ($this->getCallbackMethod() == 'POST') ?
$this->httpRequest->request->all() :
$this->httpRequest->query->all();
if (empty($data)) {
throw new InvalidResponseException(sprintf(
"No callback data was passed in the %s request",
$this->getCallbackMethod()
));
}

return $this->httpRequest->query->all();
return $data;
}

public function sendData($data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getTransactionReference()

public function getTransactionId()
{
return isset($this->data['ORDERID']) ? $this->data['ORDERID'] : null;
return isset($this->data['orderID']) ? $this->data['orderID'] : null;
}

public function getNcError()
Expand Down

0 comments on commit 74b45d3

Please sign in to comment.