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
+13
View File
@@ -359,6 +359,19 @@ class WataService(HttpClientMixin):
if not success or not isinstance(data, dict):
return None
returned_ids = {
str(data.get("id") or "").strip(),
str(data.get("paymentLinkId") or "").strip(),
str(data.get("payment_link_id") or "").strip(),
}
returned_ids.discard("")
if returned_ids and provider_payment_id not in returned_ids:
return None
order_id = first_value(data, "orderId", "order_id")
if order_id is not None and str(order_id) != str(payment.payment_id):
return None
status = _normalized_wata_status(data) or str(data.get("status") or "").strip().lower()
if status and status not in _WATA_LINK_OPENED_STATUSES:
return None