fix: mock 20 rub
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import os
|
||||
from decimal import Decimal
|
||||
from urllib.parse import parse_qs
|
||||
import aiohttp
|
||||
@@ -20,6 +21,7 @@ ITPAY_API_BASE = 'https://api.gw.itpay.ru'
|
||||
HARDCODED_USDT_TO_RUB = Decimal('100')
|
||||
HARDCODED_GAS_RUB = Decimal('15')
|
||||
HARDCODED_OUR_COMMISSION_RUB = Decimal('25')
|
||||
HARDCODED_ITPAY_TEST_AMOUNT_RUB = Decimal('20.00')
|
||||
|
||||
|
||||
def _amount_rub_for_itpay(amount_usdt: Decimal) -> Decimal:
|
||||
@@ -36,6 +38,8 @@ async def create_order(
|
||||
logger: ILogger = Depends(get_logger),
|
||||
) -> ORJSONResponse:
|
||||
amount_rub = _amount_rub_for_itpay(body.amount_usdt)
|
||||
if (os.getenv('ITPAY_TEST_FORCE_20_RUB') or '').strip() == '1':
|
||||
amount_rub = HARDCODED_ITPAY_TEST_AMOUNT_RUB
|
||||
amount_str = str(amount_rub)
|
||||
client_payment_id = str(ULID())
|
||||
payload = {
|
||||
|
||||
Reference in New Issue
Block a user