BIP21 + LNURL fix (#4616)

In case of the unified invoice, the LNURL wasn't correct — with this change we are simply reusing th one that was issued on invoice creation instead of generating it anew on the fly.

Also fixes missing uppercasing for the QR code in case of non-unified QR.
And removes the `lightning:` scheme from the LNURL that's displayed to the user (unifies it with what we do for Onchain and Lightning)
This commit is contained in:
d11n
2023-02-10 03:23:48 +01:00
committed by GitHub
parent 0d1bab45a0
commit 753ffd401b
7 changed files with 87 additions and 30 deletions

View File

@@ -655,7 +655,7 @@ namespace BTCPayServer.Controllers
var enabledPaymentIds = store.GetEnabledPaymentIds(_NetworkProvider)
.Where(pmId => storeBlob.CheckoutType == CheckoutType.V1 ||
// Exclude LNURL for Checkout v2 + non-top up invoices
(pmId.PaymentType is not LNURLPayPaymentType || invoice.IsUnsetTopUp()))
pmId != lnurlId || invoice.IsUnsetTopUp())
.ToArray();
// Exclude Lightning if OnChainWithLnInvoiceFallback is active and we have both payment methods
@@ -805,7 +805,7 @@ namespace BTCPayServer.Controllers
AvailableCryptos = invoice.GetPaymentMethods()
.Where(i => i.Network != null && storeBlob.CheckoutType == CheckoutType.V1 ||
// Exclude LNURL for Checkout v2 + non-top up invoices
i.GetId().PaymentType is not LNURLPayPaymentType || invoice.IsUnsetTopUp())
i.GetId() != lnurlId || invoice.IsUnsetTopUp())
.Select(kv =>
{
var availableCryptoPaymentMethodId = kv.GetId();