fix(payments): reuse pending links by provider identity

This commit is contained in:
BADtochka
2026-06-10 03:42:49 +03:00
parent 5c96fcd519
commit 1fca62de75
8 changed files with 198 additions and 47 deletions
-10
View File
@@ -38,7 +38,6 @@ from .shared import (
PaymentSuccessRequest,
build_payment_record_payload,
create_webapp_payment_record,
decimal_amounts_equal,
describe_payment,
finalize_successful_payment,
finalize_webapp_link_payment,
@@ -291,15 +290,6 @@ class SeverPayService(HttpClientMixin):
return None
if str(data.get("order_id") or "") != str(payment.payment_id):
return None
try:
if not decimal_amounts_equal(data.get("amount"), getattr(payment, "amount", None)):
return None
except (TypeError, ValueError):
return None
provider_currency = normalize_payment_currency_code(data.get("currency"))
payment_currency = normalize_payment_currency_code(getattr(payment, "currency", None))
if provider_currency != payment_currency:
return None
return payment_url
async def webhook_route(self, request: web.Request) -> web.Response: