Skip to content

Commit

Permalink
make network-code optional (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondeJK authored Oct 2, 2023
1 parent 36c55fc commit a7db15d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SMS/Webhook/DeliveryReceipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class DeliveryReceipt
'message-timestamp',
'messageId',
'msisdn',
'network-code',
'price',
'status',
'to'
Expand Down Expand Up @@ -227,12 +226,15 @@ public function __construct(array $data)
$this->messageTimestamp = new DateTimeImmutable($data['message-timestamp']);
$this->messageId = $data['messageId'];
$this->msisdn = $data['msisdn'];
$this->networkCode = $data['network-code'];
$this->price = $data['price'];
$this->status = $data['status'];
$this->to = $data['to'];
$this->apiKey = $data['api-key'];

if (isset($data['network-code'])) {
$this->networkCode = $data['network-code'];
}

if (isset($data['client-ref'])) {
$this->clientRef = $data['client-ref'];
}
Expand Down

0 comments on commit a7db15d

Please sign in to comment.