From f124a4db6a7824251aa065d83389995745805bc0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 1 Dec 2020 08:15:43 -0600 Subject: [PATCH] fix tests --- src/Channels/NexmoSmsChannel.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Channels/NexmoSmsChannel.php b/src/Channels/NexmoSmsChannel.php index b98b7d2..cc24d9c 100644 --- a/src/Channels/NexmoSmsChannel.php +++ b/src/Channels/NexmoSmsChannel.php @@ -54,13 +54,18 @@ public function send($notifiable, Notification $notification) $message = new NexmoMessage($message); } - return ($message->client ?? $this->nexmo)->message()->send([ + $payload = [ 'type' => $message->type, 'from' => $message->from ?: $this->from, 'to' => $to, 'text' => trim($message->content), 'client_ref' => $message->clientReference, - 'callback' => $message->statusCallback, - ]); + ]; + + if ($message->statusCallback) { + $payload['client_ref'] = $message->clientReference; + } + + return ($message->client ?? $this->nexmo)->message()->send($payload); } }