
    h                     >    S SK r S SKrS SKJr  S SKJr  S\S\4S jrg)    N)HTTPException)get_random_intto_phoneotpc                   #    [         R                  " S5      n[         R                  " S5      nSnUUU SU S3S[        S5       S.n [        R                  " S	S
9 IS h  vN nUR                  XES9I S h  vN nUR                  S:w  a!  [        UR                  SUR                   3S9eUR                  S:X  a   S S S 5      IS h  vN   gUR                  5       sS S S 5      IS h  vN   $  N Nz N* N! , IS h  vN  (       d  f       g = f! [        R                   a  n[        SSU SU 3S9eS nAf[         a  n[        SSU 3S9eS nAff = f7f)NBEST_COM_API_KEYBEST_COM_API_SECRETzhttps://bestcom.tg/api/send-smszVotre code OTP est : z". Ce code expirera dans 5 minutes.MIASSA	   )Api_Key
Api_secretContactMessageTitre	Matricule<   )timeout)data   zError when sending SMS: )status_codedetailz;{"error_code":403,"error_message":"Transaction not found."}i  z&Network error when sending request to z: zSomething is wrong: )osgetenvr   httpxAsyncClientpostr   r   textjsonRequestError	Exception)	r   r   api_key
api_secreturlparamsclientresponseexcs	            9D:\kofCorporation\kof-academy-backend\app\services\sms.pysend_otp_phoner*   	   sT    ii*+G01J
+C  *3%/QR&q)*F
$$R00F#[[[::H ##s*# ( 4 45hmm_E  }} ]] 100 ==? 100: 1000  
;C53%H
 	
  
)#/
 	

s   AE	D !C1"D %C98C39AC9?D 
C5D EC9D +C7,D 0E1D 3C95D 7D 9D?D DD ED E'D77EEEE)r   r   fastapir   app.utils.helpersr   strr*        r)   <module>r0      s$    	  ! ,'
3 '
S '
r/   