From 911338e813e96cf7168c72e7db6e701377cb98b8 Mon Sep 17 00:00:00 2001 From: Wisdom Ebong <30173059+webong@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:42:01 +0100 Subject: [PATCH] Fix Mteja Addon to handle HTTP request from callback service (#4844) * chore: update the http request handler * chore: update Mteja ShortMessageController --------- Co-authored-by: Mh-Asmi --- src/Ushahidi/Addons/Mteja/ShortMessageController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ushahidi/Addons/Mteja/ShortMessageController.php b/src/Ushahidi/Addons/Mteja/ShortMessageController.php index 370b0a8089..61f8e3b86d 100644 --- a/src/Ushahidi/Addons/Mteja/ShortMessageController.php +++ b/src/Ushahidi/Addons/Mteja/ShortMessageController.php @@ -24,21 +24,21 @@ class ShortMessageController extends DataSourceController public function handleRequest(Request $request) { // Remove Non-Numeric characters because that's what the DB has - $from = preg_replace("/[^0-9,+.]/", "", $request->input('from')); + $from = preg_replace("/[^0-9,+.]/", "", $request->input('customerNumber')); $this->save([ 'type' => MessageType::SMS, 'from' => $from, 'contact_type' => Contact::PHONE, 'message' => $request->input('text'), - 'to' => $request->input('to'), + 'to' => $request->input('virtualNumber'), 'title' => null, - 'datetime' => null, - 'data_source_message_id' => "mteja-" . UUID::uuid4()->toString(), + 'datetime' => $request->input('date'), + 'data_source_message_id' => $request->input('atSmsId', UUID::uuid4()->toString()), 'data_source' => 'mteja', 'additional_data' => [ - 'fieldName' => $request->input('fieldName'), - 'questionText' => $request->input('questionText') + 'appId' => $request->input('appId'), + // 'questionText' => $request->input('questionText') ] ]);