Skip to content

Commit a7db15d

Browse files
authored
make network-code optional (#438)
1 parent 36c55fc commit a7db15d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/SMS/Webhook/DeliveryReceipt.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ class DeliveryReceipt
149149
'message-timestamp',
150150
'messageId',
151151
'msisdn',
152-
'network-code',
153152
'price',
154153
'status',
155154
'to'
@@ -227,12 +226,15 @@ public function __construct(array $data)
227226
$this->messageTimestamp = new DateTimeImmutable($data['message-timestamp']);
228227
$this->messageId = $data['messageId'];
229228
$this->msisdn = $data['msisdn'];
230-
$this->networkCode = $data['network-code'];
231229
$this->price = $data['price'];
232230
$this->status = $data['status'];
233231
$this->to = $data['to'];
234232
$this->apiKey = $data['api-key'];
235233

234+
if (isset($data['network-code'])) {
235+
$this->networkCode = $data['network-code'];
236+
}
237+
236238
if (isset($data['client-ref'])) {
237239
$this->clientRef = $data['client-ref'];
238240
}

0 commit comments

Comments
 (0)