diff --git a/BTCPayServer/Views/Stores/PayButton.cshtml b/BTCPayServer/Views/Stores/PayButton.cshtml index d48afa985..e0ee81ece 100644 --- a/BTCPayServer/Views/Stores/PayButton.cshtml +++ b/BTCPayServer/Views/Stores/PayButton.cshtml @@ -153,6 +153,9 @@

Preview

+

Link

+ Alternatively, you can share this link or encode it in a QR code +

diff --git a/BTCPayServer/wwwroot/paybutton/paybutton.js b/BTCPayServer/wwwroot/paybutton/paybutton.js index e7754dd5d..a826c06d6 100644 --- a/BTCPayServer/wwwroot/paybutton/paybutton.js +++ b/BTCPayServer/wwwroot/paybutton/paybutton.js @@ -188,7 +188,17 @@ function inputChanges(event, buttonSize) { $("#mainCode").text(html).html(); $("#preview").html(html); - + var form = document.querySelector("#preview form"); + var url = new URL(form.getAttribute("action")); + var formData = new FormData(form); + formData.forEach((value, key) => { + if(key !== "jsonResponse"){ + url.searchParams.append(key, value); + } + }); + url = url.href; + $("#preview-link").append(`${url}`) + $('pre code').each(function (i, block) { hljs.highlightBlock(block); });