From 1e9978d1e38d10dcb25abbd36518ad7a4166a448 Mon Sep 17 00:00:00 2001 From: Ali Sasani Date: Wed, 4 Dec 2024 12:58:22 +0330 Subject: [PATCH] [fix] fix kavenegar response key --- src/Drivers/Kavenegar/KavenegarConnector.php | 2 +- src/Traits/HasResponse.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Drivers/Kavenegar/KavenegarConnector.php b/src/Drivers/Kavenegar/KavenegarConnector.php index 3dff7b6..b95f009 100644 --- a/src/Drivers/Kavenegar/KavenegarConnector.php +++ b/src/Drivers/Kavenegar/KavenegarConnector.php @@ -97,7 +97,7 @@ public function outbox($page_size = 100, $page_number = 1): object $response = $this->performApi($url); return collect($response->entries)->map(function ($item) { - return $this->generateReportResponse($item->message_id, $item->receptor, $item->message, $item->date, $item->sender, $item->cost); + return $this->generateReportResponse($item->messageid, $item->receptor, $item->message, $item->date, $item->sender, $item->cost, $item->statustext); }); } diff --git a/src/Traits/HasResponse.php b/src/Traits/HasResponse.php index 7edb6bc..6ddd394 100644 --- a/src/Traits/HasResponse.php +++ b/src/Traits/HasResponse.php @@ -51,9 +51,8 @@ public function generateAccountResponse($credit, $expire_date): object ]; } - public function generateReportResponse($message_id, $receptor, $content, $sent_date, $line_number, $cost = null): object + public function generateReportResponse($message_id, $receptor, $content, $sent_date, $line_number, $cost = null, $status_text = null): object { - return (object) [ 'message_id' => $message_id, 'receptor' => $receptor, @@ -61,7 +60,7 @@ public function generateReportResponse($message_id, $receptor, $content, $sent_d 'sent_date' => $sent_date, 'line_number' => $line_number, 'cost' => $cost, - + 'status_text' => $status_text, ]; } }