mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 12:26:19 +02:00
tweaked create_invoice
This commit is contained in:
@@ -50,11 +50,12 @@ async def create_invoice(
|
|||||||
webhook: Optional[str] = None,
|
webhook: Optional[str] = None,
|
||||||
conn: Optional[Connection] = None,
|
conn: Optional[Connection] = None,
|
||||||
) -> Tuple[str, str]:
|
) -> Tuple[str, str]:
|
||||||
invoice_memo = None if description_hash else memo
|
if not memo:
|
||||||
storeable_memo = memo or "LN payment"
|
memo = "LN payment"
|
||||||
|
# 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=invoice_memo, description_hash=description_hash
|
amount=amount, memo=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.")
|
||||||
|
@@ -82,7 +82,6 @@ async def api_lnurl_callback(request: Request, link_id):
|
|||||||
return LnurlErrorResponse(
|
return LnurlErrorResponse(
|
||||||
reason=f"Got a comment with {len(comment)} characters, but can only accept {link.comment_chars}"
|
reason=f"Got a comment with {len(comment)} characters, but can only accept {link.comment_chars}"
|
||||||
).dict()
|
).dict()
|
||||||
|
|
||||||
payment_hash, payment_request = await create_invoice(
|
payment_hash, payment_request = await create_invoice(
|
||||||
wallet_id=link.wallet,
|
wallet_id=link.wallet,
|
||||||
amount=int(amount_received / 1000),
|
amount=int(amount_received / 1000),
|
||||||
|
Reference in New Issue
Block a user