basic offlineshop functionality.
This commit is contained in:
+5
-8
@@ -131,14 +131,15 @@ async def get_wallet_for_key(key: str, key_type: str = "invoice") -> Optional[Wa
|
||||
# ---------------
|
||||
|
||||
|
||||
async def get_standalone_payment(checking_id: str) -> Optional[Payment]:
|
||||
async def get_standalone_payment(checking_id_or_hash: str) -> Optional[Payment]:
|
||||
row = await db.fetchone(
|
||||
"""
|
||||
SELECT *
|
||||
FROM apipayments
|
||||
WHERE checking_id = ?
|
||||
WHERE checking_id = ? OR payment_hash = ?
|
||||
LIMIT 1
|
||||
""",
|
||||
(checking_id,),
|
||||
(checking_id_or_hash, checking_id_or_hash),
|
||||
)
|
||||
|
||||
return Payment.from_row(row) if row else None
|
||||
@@ -285,11 +286,7 @@ async def create_payment(
|
||||
|
||||
async def update_payment_status(checking_id: str, pending: bool) -> None:
|
||||
await db.execute(
|
||||
"UPDATE apipayments SET pending = ? WHERE checking_id = ?",
|
||||
(
|
||||
int(pending),
|
||||
checking_id,
|
||||
),
|
||||
"UPDATE apipayments SET pending = ? WHERE checking_id = ?", (int(pending), checking_id,),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user