feat: use web page for cryptopay in web app

This commit is contained in:
3252a8
2026-04-27 14:38:09 +03:00
parent 0610156f80
commit 70b618a94b
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -70,6 +70,7 @@ class CryptoPayService:
amount: float,
description: str,
sale_mode: str = "subscription",
url_kind: str = "bot",
) -> Optional[str]:
if not self.configured or not self.client:
logging.error("CryptoPayService not configured")
@@ -128,6 +129,12 @@ class CryptoPayService:
payment_record.payment_id,
)
return None
if url_kind == "web":
return (
getattr(invoice, "web_app_invoice_url", None)
or getattr(invoice, "mini_app_invoice_url", None)
or invoice.bot_invoice_url
)
return invoice.bot_invoice_url
except Exception:
logging.exception("CryptoPay invoice creation failed.")