mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-27 01:01:02 +02:00
abstract get latest payments for extensions
This commit is contained in:
parent
a2092675cd
commit
4549190e86
@ -229,6 +229,24 @@ async def get_wallet_payment(
|
|||||||
return Payment.from_row(row) if row else None
|
return Payment.from_row(row) if row else None
|
||||||
|
|
||||||
|
|
||||||
|
async def get_latest_payments_by_extension(ext_name: str, ext_id: str, limit: int = 5):
|
||||||
|
rows = await db.fetchall(
|
||||||
|
f"""
|
||||||
|
SELECT * FROM apipayments
|
||||||
|
WHERE pending = 'false'
|
||||||
|
AND extra LIKE ?
|
||||||
|
AND extra LIKE ?
|
||||||
|
ORDER BY time DESC LIMIT {limit}
|
||||||
|
""",
|
||||||
|
(
|
||||||
|
f"%{ext_name}%",
|
||||||
|
f"%{ext_id}%",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
return rows
|
||||||
|
|
||||||
|
|
||||||
async def get_payments(
|
async def get_payments(
|
||||||
*,
|
*,
|
||||||
wallet_id: Optional[str] = None,
|
wallet_id: Optional[str] = None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user