feat: add endpoints desc

This commit is contained in:
2026-05-11 19:50:25 +03:00
parent 852ee9ec2e
commit 46b1e336d9
22 changed files with 236 additions and 95 deletions

View File

@@ -8,7 +8,7 @@ from aiohttp import BasicAuth, ClientTimeout
from src.application.contracts.i_itpay_service import IItPayService
from src.application.domain.entities.order import OrderEntity
from src.application.domain.enums import OrderStatus
from src.application.domain.exceptions import ApplicationException
from src.application.domain.exceptions import ApplicationException,PaymentProviderException
class ItPayClient(IItPayService):
@@ -68,7 +68,7 @@ class ItPayClient(IItPayService):
except orjson.JSONDecodeError:
response_json = {'raw': response_text}
if resp.status >= 400:
raise ApplicationException(status_code=502, message='Payment provider error')
raise PaymentProviderException(message='Payment provider error')
body_raw = response_json.get('data')
body = body_raw if isinstance(body_raw, dict) else response_json
@@ -112,4 +112,4 @@ class ItPayClient(IItPayService):
except ApplicationException:
raise
except aiohttp.ClientError:
raise ApplicationException(status_code=502, message='Payment provider unreachable')
raise PaymentProviderException(message='Payment provider unreachable')