mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-08 19:50:10 +02:00
refactor: rename is_uncheckable (#2670)
it actually means is_internal and internal payments cant fail so we return success status
This commit is contained in:
@@ -21,8 +21,8 @@ from lnbits.settings import settings
|
|||||||
from lnbits.utils.exchange_rates import allowed_currencies
|
from lnbits.utils.exchange_rates import allowed_currencies
|
||||||
from lnbits.wallets import get_funding_source
|
from lnbits.wallets import get_funding_source
|
||||||
from lnbits.wallets.base import (
|
from lnbits.wallets.base import (
|
||||||
PaymentPendingStatus,
|
|
||||||
PaymentStatus,
|
PaymentStatus,
|
||||||
|
PaymentSuccessStatus,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -285,12 +285,12 @@ class Payment(FromRowModel):
|
|||||||
return self.expiry < time.time() if self.expiry else False
|
return self.expiry < time.time() if self.expiry else False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_uncheckable(self) -> bool:
|
def is_internal(self) -> bool:
|
||||||
return self.checking_id.startswith("internal_")
|
return self.checking_id.startswith("internal_")
|
||||||
|
|
||||||
async def check_status(self) -> PaymentStatus:
|
async def check_status(self) -> PaymentStatus:
|
||||||
if self.is_uncheckable:
|
if self.is_internal:
|
||||||
return PaymentPendingStatus()
|
return PaymentSuccessStatus()
|
||||||
funding_source = get_funding_source()
|
funding_source = get_funding_source()
|
||||||
if self.is_out:
|
if self.is_out:
|
||||||
status = await funding_source.get_payment_status(self.checking_id)
|
status = await funding_source.get_payment_status(self.checking_id)
|
||||||
|
Reference in New Issue
Block a user