From c22329e86ba9d15fe2f372ced909633164a6d284 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Thu, 27 Oct 2022 15:54:50 +0100 Subject: [PATCH] fix invoices extra props --- lnbits/extensions/tpos/tasks.py | 2 +- lnbits/extensions/tpos/views_api.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lnbits/extensions/tpos/tasks.py b/lnbits/extensions/tpos/tasks.py index 6eb1d5d1..7c6a1529 100644 --- a/lnbits/extensions/tpos/tasks.py +++ b/lnbits/extensions/tpos/tasks.py @@ -51,6 +51,6 @@ async def on_invoice_paid(payment: Payment) -> None: checking_id = await pay_invoice( payment_request=payment_request, wallet_id=payment.wallet_id, - extra={"tag": "tpos"}, + extra={**payment.extra, "tipSplitted": True}, ) logger.debug(f"tpos: tip invoice paid: {checking_id}") diff --git a/lnbits/extensions/tpos/views_api.py b/lnbits/extensions/tpos/views_api.py index 3a51238a..76dcf9c4 100644 --- a/lnbits/extensions/tpos/views_api.py +++ b/lnbits/extensions/tpos/views_api.py @@ -75,7 +75,12 @@ async def api_tpos_create_invoice( wallet_id=tpos.wallet, amount=amount, memo=f"{tpos.name}", - extra={"tag": "tpos", "tipAmount": tipAmount, "tposId": tpos_id}, + extra={ + "tag": "tpos", + "tipAmount": tipAmount, + "tposId": tpos_id, + "amount": amount - tipAmount if tipAmount else False, + }, ) except Exception as e: raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e))