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" => "" ];