Skip to content

Commit

Permalink
Merge pull request #27 from alissn/UpdateResponse
Browse files Browse the repository at this point in the history
fix `Kavenegar` response key
  • Loading branch information
miladnouri authored Dec 4, 2024
2 parents b9af6bb + 1e9978d commit eef7e3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Drivers/Kavenegar/KavenegarConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down
5 changes: 2 additions & 3 deletions src/Traits/HasResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,16 @@ 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,
'content' => $content,
'sent_date' => $sent_date,
'line_number' => $line_number,
'cost' => $cost,

'status_text' => $status_text,
];
}
}

0 comments on commit eef7e3a

Please sign in to comment.