feat: add endpoints desc
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user