[FEAT] save fiat amount in api_create_invoice (#1869)
save user input into extra when he chooses a currency for api_create invoice
This commit is contained in:
parent
c4da1dfdce
commit
88c07acc2c
1 changed files with 2 additions and 0 deletions
|
|
@ -187,6 +187,7 @@ async def api_payments_paginated(
|
|||
|
||||
|
||||
async def api_payments_create_invoice(data: CreateInvoice, wallet: Wallet):
|
||||
extra = data.extra or {}
|
||||
if data.description_hash or data.unhashed_description:
|
||||
try:
|
||||
description_hash = (
|
||||
|
|
@ -217,6 +218,7 @@ async def api_payments_create_invoice(data: CreateInvoice, wallet: Wallet):
|
|||
assert data.unit is not None, "unit not set"
|
||||
price_in_sats = await fiat_amount_as_satoshis(data.amount, data.unit)
|
||||
amount = price_in_sats
|
||||
extra.update({"fiat_amount": data.amount, "fiat_currency": data.unit})
|
||||
|
||||
async with db.connect() as conn:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue