feat: public id

This commit is contained in:
2026-04-22 12:36:20 +03:00
parent a146a6a3e9
commit 814ba9f318
2 changed files with 24 additions and 8 deletions

View File

@@ -52,14 +52,14 @@ async def create_order(
}
url = f'{ITPAY_API_BASE}/v1/payments'
headers = {
'Authorization': settings.ITPAY_AUTHORIZATION,
'Content-Type': 'application/json',
'Accept': 'application/json',
}
try:
timeout = aiohttp.ClientTimeout(total=30)
async with aiohttp.ClientSession(timeout=timeout) as session:
async with session.post(url, json=payload, headers=headers) as resp:
auth = aiohttp.BasicAuth(settings.ITPAY_PUBLIC_ID, settings.ITPAY_API_SECRET)
async with session.post(url, json=payload, headers=headers, auth=auth) as resp:
response_text = await resp.text()
try:
response_json = json.loads(response_text)