Skip to content

Commit

Permalink
Return error message on Response::getMessage() too.
Browse files Browse the repository at this point in the history
  • Loading branch information
emr committed Aug 21, 2019
1 parent f8932f4 commit 04dea3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Message/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ public function getTransactionReference()
*/
public function getMessage()
{
return (string) $this->data["Transaction"]->Response->Message;
if ($this->isSuccessful()) {
return (string) $this->data["Transaction"]->Response->Message;
}

return $this->getError();
}

/**
Expand Down

0 comments on commit 04dea3f

Please sign in to comment.