Skip to content

Commit e7bf57c

Browse files
committed
Code update for the new httpx version
1 parent 88d9247 commit e7bf57c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/apps/tinkoff/dolyame.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import ssl
12
from decimal import Decimal
23
from urllib.parse import urljoin
34

@@ -59,14 +60,17 @@ def refund(self, amount: Decimal | None = None) -> None:
5960

6061
def post(self, method: str, payload: dict) -> dict:
6162
"""Query Dolyame API"""
63+
ssl_context = ssl.create_default_context()
64+
ssl_context.load_cert_chain(certfile=settings.DOLYAME_CERTIFICATE_PATH)
65+
6266
response = httpx.post(
6367
url=urljoin(self.base_url, method),
6468
json=payload,
6569
auth=(settings.DOLYAME_LOGIN, settings.DOLYAME_PASSWORD),
6670
headers={
6771
"X-Correlation-ID": self.idempotency_key,
6872
},
69-
cert=settings.DOLYAME_CERTIFICATE_PATH,
73+
verify=ssl_context,
7074
)
7175

7276
if response.status_code != 200:

0 commit comments

Comments
 (0)