Skip to content

Commit 04dea3f

Browse files
committed
Return error message on Response::getMessage() too.
1 parent f8932f4 commit 04dea3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Message/Response.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ public function getTransactionReference()
8080
*/
8181
public function getMessage()
8282
{
83-
return (string) $this->data["Transaction"]->Response->Message;
83+
if ($this->isSuccessful()) {
84+
return (string) $this->data["Transaction"]->Response->Message;
85+
}
86+
87+
return $this->getError();
8488
}
8589

8690
/**

0 commit comments

Comments
 (0)