diff --git a/BTCPayServer.Tests/BTCPayServer.Tests.csproj b/BTCPayServer.Tests/BTCPayServer.Tests.csproj index 7ed0c9e63..6683253d7 100644 --- a/BTCPayServer.Tests/BTCPayServer.Tests.csproj +++ b/BTCPayServer.Tests/BTCPayServer.Tests.csproj @@ -23,7 +23,7 @@ - + all diff --git a/BTCPayServer/Controllers/UILNURLController.cs b/BTCPayServer/Controllers/UILNURLController.cs index af40d3f17..a3c2c4138 100644 --- a/BTCPayServer/Controllers/UILNURLController.cs +++ b/BTCPayServer/Controllers/UILNURLController.cs @@ -524,8 +524,21 @@ namespace BTCPayServer Url = _linkGenerator.GetUriByAction(HttpContext, "InvoiceReceipt", "UIInvoice", new { invoiceId}) }; } - if (amount.HasValue && string.IsNullOrEmpty(paymentMethodDetails.BOLT11) || - paymentMethodDetails.GeneratedBoltAmount != amount) + + if (amount is null) + { + return Ok(new LNURLPayRequest + { + Tag = "payRequest", + MinSendable = min, + MaxSendable = max, + CommentAllowed = lnurlSupportedPaymentMethod.LUD12Enabled ? 2000 : 0, + Metadata = metadata, + Callback = new Uri(Request.GetCurrentUrl()) + }); + } + + if (string.IsNullOrEmpty(paymentMethodDetails.BOLT11) || paymentMethodDetails.GeneratedBoltAmount != amount) { var client = _lightningLikePaymentHandler.CreateLightningClient( @@ -589,7 +602,7 @@ namespace BTCPayServer }); } - if (amount.HasValue && paymentMethodDetails.GeneratedBoltAmount == amount) + if (paymentMethodDetails.GeneratedBoltAmount == amount) { if (lnurlSupportedPaymentMethod.LUD12Enabled && paymentMethodDetails.ProvidedComment != comment) { @@ -604,19 +617,6 @@ namespace BTCPayServer SuccessAction = successAction }); } - - if (amount is null) - { - return Ok(new LNURLPayRequest - { - Tag = "payRequest", - MinSendable = min, - MaxSendable = max, - CommentAllowed = lnurlSupportedPaymentMethod.LUD12Enabled ? 2000 : 0, - Metadata = metadata, - Callback = new Uri(Request.GetCurrentUrl()) - }); - } } return BadRequest(new LNUrlStatusResponse diff --git a/BTCPayServer/Views/UIWallets/WalletSend.cshtml b/BTCPayServer/Views/UIWallets/WalletSend.cshtml index 2546ac27a..5bb6fd648 100644 --- a/BTCPayServer/Views/UIWallets/WalletSend.cshtml +++ b/BTCPayServer/Views/UIWallets/WalletSend.cshtml @@ -221,9 +221,6 @@ @if (Model.SupportRBF)