fix invoices extra props

This commit is contained in:
Tiago Vasconcelos 2022-10-27 15:54:50 +01:00
parent c0f742bc3e
commit c22329e86b
2 changed files with 7 additions and 2 deletions

View file

@ -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}")

View file

@ -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))