diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index fb909ee72..53cf2bbf2 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -2092,13 +2092,13 @@ namespace BTCPayServer.Tests Assert.IsType(res).Model ); Assert.Contains("&lightning=", paymentMethodSecond.InvoiceBitcoinUrlQR); - Assert.StartsWith("BITCOIN:", paymentMethodSecond.InvoiceBitcoinUrlQR); + Assert.StartsWith("bitcoin:", paymentMethodSecond.InvoiceBitcoinUrlQR); var split = paymentMethodSecond.InvoiceBitcoinUrlQR.Split('?')[0]; // Standard for uppercase Bech32 addresses in QR codes is still not implemented in all wallets // When it is widely propagated consider uncommenting these lines //Assert.True($"BITCOIN:{paymentMethodSecond.BtcAddress.ToUpperInvariant()}" == split); - Assert.True($"BITCOIN:{paymentMethodSecond.BtcAddress}" == split); + Assert.True($"bitcoin:{paymentMethodSecond.BtcAddress}" == split); } } diff --git a/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs b/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs index 443383384..d0328c38d 100644 --- a/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs +++ b/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs @@ -65,14 +65,17 @@ namespace BTCPayServer.Payments.Bitcoin } model.InvoiceBitcoinUrl = cryptoInfo.PaymentUrls.BIP21 + lightningFallback; - // We're trying to make as many characters uppercase to make QR smaller - // Ref: https://github.com/btcpayserver/btcpayserver/pull/2060#issuecomment-723828348 - model.InvoiceBitcoinUrlQR = cryptoInfo.PaymentUrls.BIP21 - .Replace("bitcoin:", "BITCOIN:", StringComparison.OrdinalIgnoreCase) - + lightningFallback.ToUpperInvariant().Replace("LIGHTNING=", "lightning=", StringComparison.OrdinalIgnoreCase); + model.InvoiceBitcoinUrlQR = model.InvoiceBitcoinUrl; // Standard for uppercase Bech32 addresses in QR codes is still not implemented in all wallets // When it is widely propagated consider uncommenting these lines + + // We're trying to make as many characters uppercase to make QR smaller + // Ref: https://github.com/btcpayserver/btcpayserver/pull/2060#issuecomment-723828348 + //model.InvoiceBitcoinUrlQR = cryptoInfo.PaymentUrls.BIP21 + // .Replace("bitcoin:", "BITCOIN:", StringComparison.OrdinalIgnoreCase) + // + lightningFallback.ToUpperInvariant().Replace("LIGHTNING=", "lightning=", StringComparison.OrdinalIgnoreCase); + //if (bech32Prefixes.Any(a => model.BtcAddress.StartsWith(a, StringComparison.OrdinalIgnoreCase))) //{ // model.InvoiceBitcoinUrlQR = model.InvoiceBitcoinUrlQR.Replace(