fix: lnbits funding source (#2319)
fix a bug where payments are deleted
This commit is contained in:
@@ -129,12 +129,16 @@ class LNbitsWallet(Wallet):
|
||||
r = await self.client.get(url=f"/api/v1/payments/{checking_id}")
|
||||
|
||||
if r.is_error:
|
||||
return PaymentStatus(False)
|
||||
return PaymentStatus(None)
|
||||
data = r.json()
|
||||
if "paid" not in data and "details" not in data:
|
||||
|
||||
if "paid" not in data or not data["paid"]:
|
||||
return PaymentStatus(None)
|
||||
|
||||
return PaymentStatus(data["paid"], data["details"]["fee"], data["preimage"])
|
||||
if "details" not in data:
|
||||
return PaymentStatus(None)
|
||||
|
||||
return PaymentStatus(True, data["details"]["fee"], data["preimage"])
|
||||
|
||||
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
|
||||
url = f"{self.endpoint}/api/v1/payments/sse"
|
||||
|
||||
Reference in New Issue
Block a user