diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index 801731a6..704428a2 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -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: