mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-13 14:32:44 +02:00
Merge pull request #379 from arcbtc/FastAPI
restored create invoice api endpoint
This commit is contained in:
@ -44,7 +44,7 @@ async def create_invoice(
|
|||||||
*,
|
*,
|
||||||
wallet_id: str,
|
wallet_id: str,
|
||||||
amount: int, # in satoshis
|
amount: int, # in satoshis
|
||||||
memo: str,
|
memo: Optional[str] = None,
|
||||||
description_hash: Optional[bytes] = None,
|
description_hash: Optional[bytes] = None,
|
||||||
extra: Optional[Dict] = None,
|
extra: Optional[Dict] = None,
|
||||||
webhook: Optional[str] = None,
|
webhook: Optional[str] = None,
|
||||||
@ -53,6 +53,7 @@ async def create_invoice(
|
|||||||
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
|
||||||
|
|
||||||
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=invoice_memo, description_hash=description_hash
|
amount=amount, memo=invoice_memo, description_hash=description_hash
|
||||||
)
|
)
|
||||||
@ -68,7 +69,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=invoice_memo,
|
memo=memo,
|
||||||
extra=extra,
|
extra=extra,
|
||||||
webhook=webhook,
|
webhook=webhook,
|
||||||
conn=conn,
|
conn=conn,
|
||||||
|
Reference in New Issue
Block a user