docs(code): add concise docstrings
This commit is contained in:
@@ -10,17 +10,22 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class KavenegarSmsClient(SmsClient):
|
||||
"""Kavenegar verify/lookup implementation of the SMS provider strategy."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
api_key: str,
|
||||
timeout_seconds: float = 10.0,
|
||||
transport: httpx.AsyncBaseTransport | None = None,
|
||||
) -> None:
|
||||
"""Configure credentials, timeout, and optional test transport."""
|
||||
self._api_key = api_key
|
||||
self._timeout_seconds = timeout_seconds
|
||||
self._transport = transport
|
||||
|
||||
async def send_otp(self, mobile: str, code: str, template: str) -> None:
|
||||
"""Send an OTP through Kavenegar and raise on transport or API failure."""
|
||||
|
||||
url = f"https://api.kavenegar.com/v1/{self._api_key}/verify/lookup.json"
|
||||
payload = {"receptor": mobile, "template": template, "token": code, "type": "sms"}
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user