diff --git a/src/Message/ChargeResponse.php b/src/Message/ChargeResponse.php index 147805e..8d2f14d 100755 --- a/src/Message/ChargeResponse.php +++ b/src/Message/ChargeResponse.php @@ -38,27 +38,27 @@ public function getRedirectData() public function getTransactionId() { - return $this->data['transactionId']; + return $this->data['transactionId'] ?? null; } public function getTenders() { - return $this->data['tenders']; + return $this->data['tenders'] ?? null; } public function getOrderId() { - return $this->data['orderId']; + return $this->data['orderId'] ?? null; } public function getCreatedAt() { - return $this->data['created_at']; + return $this->data['created_at'] ?? null; } public function getReferenceId() { - return $this->data['referenceId']; + return $this->data['referenceId'] ?? null; } public function getMessage() @@ -68,7 +68,7 @@ public function getMessage() $message .= $this->data['code'] . ': '; } - return $message . ($this->data['error'] ?? ''); + return $message . ($this->data['detail'] ?? ''); } /** @@ -84,10 +84,10 @@ public function getTransactionReference() /** * Get the tender id that is used for processing refunds * - * @return string + * @return null|string */ public function getBillingId() { - return $this->getTenders()[0]['id']; + return $this->getTenders()[0]['id'] ?? null; } }