We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88d9247 commit e7bf57cCopy full SHA for e7bf57c
src/apps/tinkoff/dolyame.py
@@ -1,3 +1,4 @@
1
+import ssl
2
from decimal import Decimal
3
from urllib.parse import urljoin
4
@@ -59,14 +60,17 @@ def refund(self, amount: Decimal | None = None) -> None:
59
60
61
def post(self, method: str, payload: dict) -> dict:
62
"""Query Dolyame API"""
63
+ ssl_context = ssl.create_default_context()
64
+ ssl_context.load_cert_chain(certfile=settings.DOLYAME_CERTIFICATE_PATH)
65
+
66
response = httpx.post(
67
url=urljoin(self.base_url, method),
68
json=payload,
69
auth=(settings.DOLYAME_LOGIN, settings.DOLYAME_PASSWORD),
70
headers={
71
"X-Correlation-ID": self.idempotency_key,
72
},
- cert=settings.DOLYAME_CERTIFICATE_PATH,
73
+ verify=ssl_context,
74
)
75
76
if response.status_code != 200:
0 commit comments