Skip to content

Commit

Permalink
MAG-745: Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ebanolopes committed Jun 8, 2022
1 parent 12d7aaf commit 4bacc9a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Core/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ public function handleResponse($info, $response, $error, $type)
}

if ($info['http_code'] == 0) {
$responseObj->addMessage($info['http_code'], $error);
$responseObj->addMessage($error);
return $responseObj;
}

if ($info['http_code'] >= 200 && $info['http_code'] < 300) {
$responseObj->setObject($response);
} else {
$responseObj->addMessage($info['http_code'], $response);
$responseObj->addMessage($response);
}

return $responseObj;
Expand Down
7 changes: 7 additions & 0 deletions lib/Core/Response/CaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ class CaseResponse extends Response

public $recommendedAction;

public $message = [];

/**
* CaseResponse constructor.
*
Expand Down Expand Up @@ -825,4 +827,9 @@ public function setGuaranteeIneligibleReason($guaranteeIneligibleReason)
{
$this->guaranteeIneligibleReason = $guaranteeIneligibleReason;
}

public function addMessage($message)
{
$this->message[] = $message;
}
}
7 changes: 7 additions & 0 deletions lib/Core/Response/TransactionsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class TransactionsResponse extends Model
*/
public $transactions;

public $message = [];

public function __construct($logger)
{
if (!is_object($logger) || get_class($logger) !== 'Signifyd\Core\Logging') {
Expand Down Expand Up @@ -119,4 +121,9 @@ public function addTransaction($transaction)
{
$this->transactions[] = $transaction;
}

public function addMessage($message)
{
$this->message[] = $message;
}
}
7 changes: 7 additions & 0 deletions lib/Core/Response/WebhooksBulkResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class WebhooksBulkResponse extends Response
*/
public $errorMessage;

public $message = [];

/**
* The logger object
*
Expand Down Expand Up @@ -131,6 +133,11 @@ public function setErrorMessage($errorMessage)
$this->errorMessage = $errorMessage;
}

public function addMessage($message)
{
$this->message[] = $message;
}

/**
* Get the webhook array
*
Expand Down
6 changes: 6 additions & 0 deletions lib/Core/Response/WebhooksResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class WebhooksResponse extends Response

public $responseArray = [];

public $message = [];

/**
* The logging object
*
Expand Down Expand Up @@ -299,4 +301,8 @@ public function setTeam($team)
$this->team = $team;
}

public function addMessage($message)
{
$this->message[] = $message;
}
}

0 comments on commit 4bacc9a

Please sign in to comment.