refactor: dev-friendly payment status name (#2322)
* refactor: dev-friendly payment status name * refactor: change `PaymentStatus(True, ...)` to `PaymentSuccessStatus(...)`
This commit is contained in:
@@ -12,6 +12,7 @@ from lnbits.settings import settings
|
||||
|
||||
from .base import (
|
||||
InvoiceResponse,
|
||||
PaymentPendingStatus,
|
||||
PaymentResponse,
|
||||
PaymentStatus,
|
||||
StatusResponse,
|
||||
@@ -184,7 +185,7 @@ class CoreLightningRestWallet(Wallet):
|
||||
return PaymentStatus(self.statuses.get(data["invoices"][0]["status"]))
|
||||
except Exception as e:
|
||||
logger.error(f"Error getting invoice status: {e}")
|
||||
return PaymentStatus(None)
|
||||
return PaymentPendingStatus()
|
||||
|
||||
async def get_payment_status(self, checking_id: str) -> PaymentStatus:
|
||||
r = await self.client.get(
|
||||
@@ -211,7 +212,7 @@ class CoreLightningRestWallet(Wallet):
|
||||
return PaymentStatus(self.statuses.get(pay["status"]), fee_msat, preimage)
|
||||
except Exception as e:
|
||||
logger.error(f"Error getting payment status: {e}")
|
||||
return PaymentStatus(None)
|
||||
return PaymentPendingStatus()
|
||||
|
||||
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user