mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-20 13:04:23 +02:00
Merge pull request #378 from arcbtc/FastAPI
restored create invoice api endpoint
This commit is contained in:
@@ -52,10 +52,9 @@ async def create_invoice(
|
|||||||
) -> Tuple[str, str]:
|
) -> Tuple[str, str]:
|
||||||
if not memo:
|
if not memo:
|
||||||
memo = "LN payment"
|
memo = "LN payment"
|
||||||
# invoice_memo = None if description_hash else memo
|
invoice_memo = None if description_hash else memo
|
||||||
# storeable_memo = memo
|
|
||||||
ok, checking_id, payment_request, error_message = await WALLET.create_invoice(
|
ok, checking_id, payment_request, error_message = await WALLET.create_invoice(
|
||||||
amount=amount, memo=memo, description_hash=description_hash
|
amount=amount, memo=invoice_memo, description_hash=description_hash
|
||||||
)
|
)
|
||||||
if not ok:
|
if not ok:
|
||||||
raise InvoiceFailure(error_message or "Unexpected backend error.")
|
raise InvoiceFailure(error_message or "Unexpected backend error.")
|
||||||
@@ -69,7 +68,7 @@ async def create_invoice(
|
|||||||
payment_request=payment_request,
|
payment_request=payment_request,
|
||||||
payment_hash=invoice.payment_hash,
|
payment_hash=invoice.payment_hash,
|
||||||
amount=amount_msat,
|
amount=amount_msat,
|
||||||
memo=storeable_memo,
|
memo=invoice_memo,
|
||||||
extra=extra,
|
extra=extra,
|
||||||
webhook=webhook,
|
webhook=webhook,
|
||||||
conn=conn,
|
conn=conn,
|
||||||
|
Reference in New Issue
Block a user