Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Buijsrogge committed Jul 13, 2017
2 parents ea45983 + 17d4427 commit 9baf728
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/Responses/TransactionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ public function getRedirectUrl()
*/
public function getRequestedInformation()
{
$aRequestedInformation = [];
$aInformation = [];

if ($this->hasRequiredAction() && !is_null($this->aResponseData['RequiredAction']['RequestedInformation'])) {
$aRequestedInformation = $this->aResponseData['RequiredAction']['RequestedInformation'];
$aInformation = $this->aResponseData['RequiredAction']['RequestedInformation'];
}

return $aRequestedInformation;
return $aInformation;
}

/**
Expand Down Expand Up @@ -230,13 +230,7 @@ public function getRemainderAmount()
*/
public function getRemainderCurrency()
{
$mCurrency = false;

if ($this->hasToPayRemainder() && isset($this->aResponseData['RequiredAction']['PayRemainderDetails']['Currency'])) {
$mCurrency = $this->aResponseData['RequiredAction']['PayRemainderDetails']['Currency'];
}

return $mCurrency;
return $this->getPayRemainderDetail('Currency');
}

/**
Expand All @@ -246,13 +240,25 @@ public function getRemainderCurrency()
*/
public function getRemainderGroupTransaction()
{
$mGroupTransaction = false;
return $this->getPayRemainderDetail('GroupTransaction');
}

/**
* Get item out of the PayRemainderDetails array
*
* @param string $sDetailKey The key of the PayRemainderDetails item to retrieve
*
* @return bool
*/
protected function getPayRemainderDetail($sDetailKey)
{
$mValue = false;

if ($this->hasToPayRemainder() && isset($this->aResponseData['RequiredAction']['PayRemainderDetails']['GroupTransaction'])) {
$mGroupTransaction = $this->aResponseData['RequiredAction']['PayRemainderDetails']['GroupTransaction'];
if ($this->hasToPayRemainder() && isset($this->aResponseData['RequiredAction']['PayRemainderDetails'][$sDetailKey])) {
$mValue = $this->aResponseData['RequiredAction']['PayRemainderDetails'][$sDetailKey];
}

return $mGroupTransaction;
return $mValue;
}

/**
Expand Down

0 comments on commit 9baf728

Please sign in to comment.