mirror of
https://github.com/lnbits/lnbits.git
synced 2025-05-30 01:29:30 +02:00
refactor: Explicitly check for FAILED state in get_payment_status
orig commit: 5374747667ea032fc45b4d60284a5112fa140120
This commit is contained in:
parent
05423d3508
commit
18ee896aa8
@ -409,9 +409,9 @@ class StrikeWallet(Wallet):
|
||||
preimage = data.get("preimage") or data.get("preImage")
|
||||
if state in {"SUCCEEDED", "COMPLETED"}:
|
||||
return PaymentSuccessStatus(fee_msat=0, preimage=preimage)
|
||||
# todo: check for FAILED status and default to pending
|
||||
if state == "FAILED":
|
||||
return PaymentFailedStatus()
|
||||
# Default to pending for PENDING and any other states
|
||||
return PaymentPendingStatus()
|
||||
except httpx.HTTPStatusError as e:
|
||||
# todo: better handle this inside the try block
|
||||
|
Loading…
x
Reference in New Issue
Block a user