Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
c7c0ba745d | |||
e7e0b29382 | |||
83ec280a29 | |||
bffa0e7fe5 | |||
6d2d917bf1 |
@ -2092,9 +2092,13 @@ namespace BTCPayServer.Tests
|
||||
Assert.IsType<ViewResult>(res).Model
|
||||
);
|
||||
Assert.Contains("&lightning=", paymentMethodSecond.InvoiceBitcoinUrlQR);
|
||||
Assert.StartsWith("BITCOIN:", paymentMethodSecond.InvoiceBitcoinUrlQR);
|
||||
Assert.StartsWith("bitcoin:", paymentMethodSecond.InvoiceBitcoinUrlQR);
|
||||
var split = paymentMethodSecond.InvoiceBitcoinUrlQR.Split('?')[0];
|
||||
Assert.True($"BITCOIN:{paymentMethodSecond.BtcAddress.ToUpperInvariant()}" == split);
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ namespace BTCPayServer.Hosting
|
||||
services.TryAddSingleton<LightningConfigurationProvider>();
|
||||
services.TryAddSingleton<LanguageService>();
|
||||
services.TryAddSingleton<NBXplorerDashboard>();
|
||||
services.TryAddSingleton<ISyncSummaryProvider, NBXSyncSummaryProvider>();
|
||||
services.AddSingleton<ISyncSummaryProvider, NBXSyncSummaryProvider>();
|
||||
services.TryAddSingleton<StoreRepository>();
|
||||
services.TryAddSingleton<PaymentRequestRepository>();
|
||||
services.TryAddSingleton<BTCPayWalletProvider>();
|
||||
|
@ -65,21 +65,26 @@ namespace BTCPayServer.Payments.Bitcoin
|
||||
}
|
||||
|
||||
model.InvoiceBitcoinUrl = cryptoInfo.PaymentUrls.BIP21 + lightningFallback;
|
||||
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);
|
||||
//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(
|
||||
$"BITCOIN:{model.BtcAddress}", $"BITCOIN:{model.BtcAddress.ToUpperInvariant()}",
|
||||
StringComparison.OrdinalIgnoreCase
|
||||
);
|
||||
}
|
||||
//if (bech32Prefixes.Any(a => model.BtcAddress.StartsWith(a, StringComparison.OrdinalIgnoreCase)))
|
||||
//{
|
||||
// model.InvoiceBitcoinUrlQR = model.InvoiceBitcoinUrlQR.Replace(
|
||||
// $"BITCOIN:{model.BtcAddress}", $"BITCOIN:{model.BtcAddress.ToUpperInvariant()}",
|
||||
// StringComparison.OrdinalIgnoreCase
|
||||
// );
|
||||
//}
|
||||
}
|
||||
private static string[] bech32Prefixes = new[] { "bc1", "tb1", "bcrt1" };
|
||||
//private static string[] bech32Prefixes = new[] { "bc1", "tb1", "bcrt1" };
|
||||
|
||||
public override string GetCryptoImage(PaymentMethodId paymentMethodId)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>1.0.6.0</Version>
|
||||
<Version>1.0.6.2</Version>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
12
Changelog.md
12
Changelog.md
@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.6.2:
|
||||
|
||||
* Reverting uppercasing of Bech32 addresses in QR code (@Rockstardev)
|
||||
|
||||
It turns out this is not compatible with every wallets.
|
||||
|
||||
## 1.0.6.1:
|
||||
|
||||
### Bug fixes:
|
||||
|
||||
* The sync popup when the nodes are synching was not showing up (@Kukks)
|
||||
|
||||
## 1.0.6.0:
|
||||
|
||||
### Important security fix
|
||||
|
Reference in New Issue
Block a user