lnbits-legend/lnbits/extensions/tipjar/helpers.py

21 lines
571 B
Python
Raw Normal View History

2021-10-20 11:14:56 +01:00
from lnbits.core.crud import get_wallet
2021-10-20 11:14:56 +01:00
from .crud import get_tipjar
async def get_charge_details(tipjar_id):
"""Return the default details for a satspay charge"""
tipjar = await get_tipjar(tipjar_id)
wallet_id = tipjar.wallet
wallet = await get_wallet(wallet_id)
user = wallet.user
details = {
"time": 1440,
"user": user,
"lnbitswallet": wallet_id,
"onchainwallet": tipjar.onchain,
"completelink": "/tipjar/" + str(tipjar_id),
2021-10-20 12:43:31 +01:00
"completelinktext": "Thanks for the tip!",
2021-10-20 11:14:56 +01:00
}
return details