Fix: LNbits backend payent state (#2187)

This commit is contained in:
callebtc 2024-03-12 13:43:41 +01:00 committed by GitHub
parent 60839481ad
commit 14519135d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,10 +126,12 @@ class LNbitsWallet(Wallet):
return PaymentStatus(None)
async def get_payment_status(self, checking_id: str) -> PaymentStatus:
r = await self.client.get(url=f"/api/v1/payments/{checking_id}")
if r.is_error:
try:
r = await self.client.get(url=f"/api/v1/payments/{checking_id}")
r.raise_for_status()
except Exception:
return PaymentStatus(None)
data = r.json()
if "paid" not in data or not data["paid"]: