Fix/tpos tips #697 (#713)

* small fastapi convertion

* make tip add up to invoice

* make tip add to invoice

* display existing tpos

* clean console logs

* suggestion from @leesalminen

* blacked
This commit is contained in:
Tiago Vasconcelos
2022-07-25 11:19:03 +02:00
committed by GitHub
parent 4bb184e08b
commit ff5b1189b5
6 changed files with 22 additions and 16 deletions
+4 -1
View File
@@ -17,7 +17,7 @@ from .models import CreateTposData
@tpos_ext.get("/api/v1/tposs", status_code=HTTPStatus.OK)
async def api_tposs(
all_wallets: bool = Query(None), wallet: WalletTypeInfo = Depends(get_key_type)
all_wallets: bool = Query(False), wallet: WalletTypeInfo = Depends(get_key_type)
):
wallet_ids = [wallet.wallet.id]
if all_wallets:
@@ -63,6 +63,9 @@ async def api_tpos_create_invoice(
status_code=HTTPStatus.NOT_FOUND, detail="TPoS does not exist."
)
if tipAmount:
amount += tipAmount
try:
payment_hash, payment_request = await create_invoice(
wallet_id=tpos.wallet,