ID: {{ qrCodeDialog.data.id }}
Amount: {{ qrCodeDialog.data.amount }} sat
Webhook: {{ qrCodeDialog.data.webhook_url }}
+ Success Message: {{ qrCodeDialog.data.success_text
+ }}
+ Success URL: {{ qrCodeDialog.data.success_url }}
{% endraw %}
@@ -263,6 +283,13 @@
align: 'left',
label: 'Webhook URL',
field: 'webhook_url'
+ },
+ {
+ name: 'success_action',
+ align: 'center',
+ label: '',
+ format: (_, row) =>
+ row.success_text || row.success_url ? '💬' : ''
}
],
pagination: {
@@ -341,12 +368,28 @@
updatePayLink: function (wallet, data) {
var self = this
+ let values = _.omit(
+ _.pick(
+ data,
+ 'description',
+ 'amount',
+ 'webhook_url',
+ 'success_text',
+ 'success_url'
+ ),
+ (value, key) =>
+ (key === 'webhook_url' ||
+ key === 'success_text' ||
+ key === 'success_url') &&
+ (value === null || value === '')
+ )
+
LNbits.api
.request(
'PUT',
'/lnurlp/api/v1/links/' + data.id,
wallet.adminkey,
- _.pick(data, 'description', 'amount', 'webhook_url')
+ values
)
.then(function (response) {
self.payLinks = _.reject(self.payLinks, function (obj) {
diff --git a/lnbits/extensions/lnurlp/views_api.py b/lnbits/extensions/lnurlp/views_api.py
index e5485475..9dac7b39 100644
--- a/lnbits/extensions/lnurlp/views_api.py
+++ b/lnbits/extensions/lnurlp/views_api.py
@@ -57,6 +57,8 @@ async def api_link_retrieve(link_id):
"description": {"type": "string", "empty": False, "required": True},
"amount": {"type": "integer", "min": 1, "required": True},
"webhook_url": {"type": "string", "required": False},
+ "success_text": {"type": "string", "required": False},
+ "success_url": {"type": "string", "required": False},
}
)
async def api_link_create_or_update(link_id=None):