fix: pay invoice status (#2481)
* fix: rest `pay_invoice` pending instead of failed * fix: rpc `pay_invoice` pending instead of failed * fix: return "failed" value for payment * fix: handle failed status for LNbits funding source * chore: `phoenixd` todo * test: fix condition * fix: wait for payment status to be updated * fix: fail payment when explicit status provided --------- Co-authored-by: dni ⚡ <office@dnilabs.com>
This commit is contained in:
@@ -70,14 +70,11 @@ class PaymentStatus(NamedTuple):
|
||||
return self.paid is False
|
||||
|
||||
def __str__(self) -> str:
|
||||
if self.paid is True:
|
||||
return "settled"
|
||||
elif self.paid is False:
|
||||
if self.success:
|
||||
return "success"
|
||||
if self.failed:
|
||||
return "failed"
|
||||
elif self.paid is None:
|
||||
return "still pending"
|
||||
else:
|
||||
return "unknown (should never happen)"
|
||||
return "pending"
|
||||
|
||||
|
||||
class PaymentSuccessStatus(PaymentStatus):
|
||||
|
||||
Reference in New Issue
Block a user