Track fiat amount in TPoS invoices. (#1384)

This commit is contained in:
Titusz 2023-01-23 10:27:19 +01:00 committed by GitHub
parent d30a6dc5c1
commit 9693e5932b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -500,6 +500,7 @@
.post('/tpos/api/v1/tposs/' + this.tposId + '/invoices', null, { .post('/tpos/api/v1/tposs/' + this.tposId + '/invoices', null, {
params: { params: {
amount: this.sat, amount: this.sat,
memo: this.amountFormatted,
tipAmount: this.tipAmountSat tipAmount: this.tipAmountSat
} }
}) })

View file

@ -58,7 +58,7 @@ async def api_tpos_delete(
@tpos_ext.post("/api/v1/tposs/{tpos_id}/invoices", status_code=HTTPStatus.CREATED) @tpos_ext.post("/api/v1/tposs/{tpos_id}/invoices", status_code=HTTPStatus.CREATED)
async def api_tpos_create_invoice( async def api_tpos_create_invoice(
tpos_id: str, amount: int = Query(..., ge=1), tipAmount: int = 0 tpos_id: str, amount: int = Query(..., ge=1), memo: str = "", tipAmount: int = 0
) -> dict: ) -> dict:
tpos = await get_tpos(tpos_id) tpos = await get_tpos(tpos_id)
@ -75,7 +75,7 @@ async def api_tpos_create_invoice(
payment_hash, payment_request = await create_invoice( payment_hash, payment_request = await create_invoice(
wallet_id=tpos.wallet, wallet_id=tpos.wallet,
amount=amount, amount=amount,
memo=f"{tpos.name}", memo=f"{memo} to {tpos.name}" if memo else f"{tpos.name}",
extra={ extra={
"tag": "tpos", "tag": "tpos",
"tipAmount": tipAmount, "tipAmount": tipAmount,