Skip to content

Commit 705b6ed

Browse files
authored
Merge pull request #5 from blasttech/blasttech-master
Bugfix: prevent undefined index errors
2 parents 3ad7c2b + 1c2a30f commit 705b6ed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Message/ChargeResponse.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,27 @@ public function getRedirectData()
3838

3939
public function getTransactionId()
4040
{
41-
return $this->data['transactionId'];
41+
return $this->data['transactionId'] ?? null;
4242
}
4343

4444
public function getTenders()
4545
{
46-
return $this->data['tenders'];
46+
return $this->data['tenders'] ?? null;
4747
}
4848

4949
public function getOrderId()
5050
{
51-
return $this->data['orderId'];
51+
return $this->data['orderId'] ?? null;
5252
}
5353

5454
public function getCreatedAt()
5555
{
56-
return $this->data['created_at'];
56+
return $this->data['created_at'] ?? null;
5757
}
5858

5959
public function getReferenceId()
6060
{
61-
return $this->data['referenceId'];
61+
return $this->data['referenceId'] ?? null;
6262
}
6363

6464
public function getMessage()
@@ -68,7 +68,7 @@ public function getMessage()
6868
$message .= $this->data['code'] . ': ';
6969
}
7070

71-
return $message . ($this->data['error'] ?? '');
71+
return $message . ($this->data['detail'] ?? '');
7272
}
7373

7474
/**
@@ -84,10 +84,10 @@ public function getTransactionReference()
8484
/**
8585
* Get the tender id that is used for processing refunds
8686
*
87-
* @return string
87+
* @return null|string
8888
*/
8989
public function getBillingId()
9090
{
91-
return $this->getTenders()[0]['id'];
91+
return $this->getTenders()[0]['id'] ?? null;
9292
}
9393
}

0 commit comments

Comments
 (0)