last fixes, normally work self node
This commit is contained in:
1 parent
8651efd578
commit
c170ca5433
3 files changed
+42
-14
No files matched your search
@@ -1,4 +1,6 @@
|
||||
from aiogram import types, Router, F
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.core.logger import make_log
|
||||
from app.core.models import StarsInvoice
|
||||
|
||||
@@ -12,9 +14,10 @@ async def t_pre_checkout_query_stars_processing(pre_checkout_query: types.PreChe
|
||||
|
||||
invoice_id = pre_checkout_query.invoice_payload
|
||||
|
||||
existing_invoice = db_session.query(StarsInvoice).filter(
|
||||
StarsInvoice.external_id == invoice_id
|
||||
).first()
|
||||
result = await db_session.execute(
|
||||
select(StarsInvoice).where(StarsInvoice.external_id == invoice_id)
|
||||
)
|
||||
existing_invoice = result.scalars().first()
|
||||
if not existing_invoice:
|
||||
return await pre_checkout_query.answer(ok=False, error_message="Invoice not found")
|
||||
|
||||
|
||||
Reference in new issue
Block a user