Files
backend-v1/core/services/didox.py
komoliddin 8a1a66a05d
All checks were successful
Deploy to Production / build-and-deploy (push) Successful in 2m9s
feat: add Didox service integration for company info retrieval
2026-04-21 13:05:45 +05:00

28 lines
669 B
Python

import requests
from django.conf import settings
import logging
logger = logging.getLogger(__name__)
class DidoxService:
BASE_URL = "https://testapi3.didox.uz/v1"
@classmethod
def get_company_info(cls, tin: int) -> dict:
url = f"{cls.BASE_URL}/utils/info/{tin}"
headers = {"Partner-Authorization": settings.DIDOX_PARTNER_TOKEN}
try:
response = requests.get(url=url, headers=headers, timeout=15,verify=False)
response.raise_for_status()
return response.json()
except requests.RequestException as e:
logger.exception(f"Didox API error: {str(e)}")
return {}