diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index 5dd6a4ee..0742220a 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -191,11 +191,18 @@ async def api_payments_pay_lnurl(): ) try: + extra = {} + + if params.get("successAction"): + extra["success_action"] = params["successAction"] + if g.data["comment"]: + extra["comment"] = g.data["comment"] + payment_hash = pay_invoice( wallet_id=g.wallet.id, payment_request=params["pr"], description=g.data.get("description", ""), - extra={"success_action": params.get("successAction")}, + extra=extra, ) except Exception as exc: traceback.print_exc(7) diff --git a/lnbits/static/js/components.js b/lnbits/static/js/components.js index 0d37f520..682da275 100644 --- a/lnbits/static/js/components.js +++ b/lnbits/static/js/components.js @@ -1,4 +1,4 @@ -/* global Vue, moment, LNbits, EventHub, decryptLnurlPayAES */ +/* global _, Vue, moment, LNbits, EventHub, decryptLnurlPayAES */ Vue.component('lnbits-fsat', { props: { @@ -179,6 +179,11 @@ Vue.component('lnbits-payment-details', { props: ['payment'], template: `
+
+ + #{{ payment.tag }} + +
Date:
{{ payment.date }} ({{ payment.dateFrom }})
@@ -203,6 +208,15 @@ Vue.component('lnbits-payment-details', {
Payment proof:
{{ payment.preimage }}
+
+
+ + extra + + {{ entry.key }}: +
+
{{ entry.value }}
+
Success action:
@@ -228,6 +242,14 @@ Vue.component('lnbits-payment-details', { this.payment.extra && this.payment.extra.success_action ) + }, + hasTag() { + return this.payment.extra && !!this.payment.extra.tag + }, + extras() { + if (!this.payment.extra) return [] + let extras = _.omit(this.payment.extra, ['tag', 'success_action']) + return Object.keys(extras).map(key => ({key, value: extras[key]})) } } })