From 817524de4bcbcae2c2311e5ef7a4adb2f94ffd4f Mon Sep 17 00:00:00 2001 From: Dineshkumar Date: Sat, 9 Jul 2022 19:34:57 +0530 Subject: [PATCH] Renamed Msg91Flow to Msg91 --- app/init.php | 2 ++ app/workers/messaging.php | 3 ++- src/Appwrite/Auth/Phone/{Msg91Flow.php => Msg91.php} | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) rename src/Appwrite/Auth/Phone/{Msg91Flow.php => Msg91.php} (94%) diff --git a/app/init.php b/app/init.php index f2d8d63298..0861f67e7a 100644 --- a/app/init.php +++ b/app/init.php @@ -27,6 +27,7 @@ use Appwrite\Auth\Phone\Mock; use Appwrite\Auth\Phone\Telesign; use Appwrite\Auth\Phone\TextMagic; use Appwrite\Auth\Phone\Twilio; +use Appwrite\Auth\Phone\Msg91; use Appwrite\DSN\DSN; use Appwrite\Event\Audit; use Appwrite\Event\Database as EventDatabase; @@ -990,6 +991,7 @@ App::setResource('phone', function () { 'twilio' => new Twilio($user, $secret), 'text-magic' => new TextMagic($user, $secret), 'telesign' => new Telesign($user, $secret), + 'msg91' => new Msg91($user, $secret), default => null }; }); diff --git a/app/workers/messaging.php b/app/workers/messaging.php index d5e1b8a311..c83eaa2d7b 100644 --- a/app/workers/messaging.php +++ b/app/workers/messaging.php @@ -5,6 +5,7 @@ use Appwrite\Auth\Phone\Mock; use Appwrite\Auth\Phone\Telesign; use Appwrite\Auth\Phone\TextMagic; use Appwrite\Auth\Phone\Twilio; +use Appwrite\Auth\Phone\Msg91; use Appwrite\DSN\DSN; use Appwrite\Resque\Worker; use Utopia\App; @@ -36,7 +37,7 @@ class MessagingV1 extends Worker 'twilio' => new Twilio($user, $secret), 'text-magic' => new TextMagic($user, $secret), 'telesign' => new Telesign($user, $secret), - 'msg91' => new Msg91Flow($user, $secret), + 'msg91' => new Msg91($user, $secret), default => null }; diff --git a/src/Appwrite/Auth/Phone/Msg91Flow.php b/src/Appwrite/Auth/Phone/Msg91.php similarity index 94% rename from src/Appwrite/Auth/Phone/Msg91Flow.php rename to src/Appwrite/Auth/Phone/Msg91.php index a3dac21b51..8ae7c44665 100644 --- a/src/Appwrite/Auth/Phone/Msg91Flow.php +++ b/src/Appwrite/Auth/Phone/Msg91.php @@ -7,7 +7,7 @@ use Appwrite\Auth\Phone; // Reference Material // https://docs.msg91.com/p/tf9GTextN/e/Irz7-x1PK/MSG91 -class Msg91Flow extends Phone +class Msg91 extends Phone { /** * @var string @@ -30,7 +30,7 @@ class Msg91Flow extends Phone $to = ltrim($to, '+'); $this->request( method: 'POST', - url: $this->endpoint . '/messages', + url: $this->endpoint, payload: \http_build_query([ 'sender' => $this->user, 'otp' => $message,