From 62023292018a992fcce385727e0bf91abb28b8fc Mon Sep 17 00:00:00 2001 From: muratcesmecioglu Date: Mon, 2 Aug 2021 11:04:14 +0300 Subject: [PATCH] =?UTF-8?q?SMS=20Do=C4=9Frulama=20Hatas=C4=B1=20=C3=87?= =?UTF-8?q?=C3=B6z=C3=BCm=C3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- src/InvoiceManager.php | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 50785b2..765f392 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "homepage": "https://github.com/furkankadioglu/efatura", "license": "MIT", - "version": "1.9.2", + "version": "1.9.3", "authors": [ { "name": "Furkan Kadıoğlu", diff --git a/src/InvoiceManager.php b/src/InvoiceManager.php index 9329e9a..856c370 100644 --- a/src/InvoiceManager.php +++ b/src/InvoiceManager.php @@ -727,6 +727,34 @@ public function sendUserInformationsData(UserInformations $userInformations = nu return $body["data"]; } + /** + * Initialize SMS Verification + * + * @return boolean + */ + + private function initializeSMSVerification() + { + $parameters = [ + "cmd" => "EARSIV_PORTAL_TELEFONNO_SORGULA", + "callid" => Uuid::uuid1()->toString(), + "pageName" => "RG_BASITTASLAKLAR", + "token" => $this->token, + "jp" => "{}", + ]; + + $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters); + $this->checkError($body); + + if(!isset($body["data"]["telefon"])) + { + return false; + } + + return true; + } + + /** * Send user informations data * @@ -735,9 +763,11 @@ public function sendUserInformationsData(UserInformations $userInformations = nu */ public function sendSMSVerification($phoneNumber) { + $this->initializeSMSVerification(); + $data = [ "CEPTEL" => $phoneNumber, - "KTEL" => false, + "KCEPTEL" => false, "TIP" => "" ];