fix: use checking_id instead of payment_hash (#104)
This commit is contained in:
parent
6aeabd2036
commit
db8de4804d
1 changed files with 4 additions and 4 deletions
8
tasks.py
8
tasks.py
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue