fix: use checking_id instead of payment_hash (#104)

This commit is contained in:
Vlad Stan 2025-10-03 15:16:15 +03:00 committed by GitHub
commit db8de4804d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,7 +81,7 @@ async def send_webhook(payment: Payment, pay_link: PayLink, zap_receipt=None):
timeout=6, timeout=6,
) )
await mark_webhook_sent( await mark_webhook_sent(
payment.payment_hash, payment.checking_id,
r.status_code, r.status_code,
r.is_success, r.is_success,
r.reason_phrase, r.reason_phrase,
@ -90,14 +90,14 @@ async def send_webhook(payment: Payment, pay_link: PayLink, zap_receipt=None):
except Exception as exc: except Exception as exc:
logger.error(exc) logger.error(exc)
await mark_webhook_sent( await mark_webhook_sent(
payment.payment_hash, -1, False, "Unexpected Error", str(exc) payment.checking_id, -1, False, "Unexpected Error", str(exc)
) )
async def mark_webhook_sent( async def mark_webhook_sent(
payment_hash: str, status: int, is_success: bool, reason_phrase="", text="" checking_id: str, status: int, is_success: bool, reason_phrase="", text=""
) -> None: ) -> None:
payment = await get_payment(payment_hash) payment = await get_payment(checking_id)
extra = payment.extra or {} extra = payment.extra or {}
extra["wh_status"] = status # keep for backwards compability extra["wh_status"] = status # keep for backwards compability
extra["wh_success"] = is_success extra["wh_success"] = is_success