diff --git a/BTCPayServer.Tests/CheckoutUITests.cs b/BTCPayServer.Tests/CheckoutUITests.cs index 294d1eae6..0d50b8355 100644 --- a/BTCPayServer.Tests/CheckoutUITests.cs +++ b/BTCPayServer.Tests/CheckoutUITests.cs @@ -164,7 +164,7 @@ namespace BTCPayServer.Tests var invoiceId = s.CreateInvoice(defaultPaymentMethod: "BTC_LightningLike"); s.GoToInvoiceCheckout(invoiceId); - Assert.Equal("Bitcoin (Lightning) (BTC)", s.Driver.FindElement(By.ClassName("payment__currencies")).Text); + Assert.Equal("Bitcoin (Lightning)", s.Driver.FindElement(By.ClassName("payment__currencies")).Text); s.Driver.Quit(); } @@ -187,7 +187,7 @@ namespace BTCPayServer.Tests var invoiceId = s.CreateInvoice(10, "USD", "a@g.com"); s.GoToInvoiceCheckout(invoiceId); - Assert.Contains("sats", s.Driver.FindElement(By.ClassName("payment__currencies_noborder")).Text); + Assert.Contains("sats", s.Driver.FindElement(By.ClassName("buyerTotalLine")).Text); } [Fact(Timeout = TestTimeout)] diff --git a/BTCPayServer/Controllers/UIInvoiceController.UI.cs b/BTCPayServer/Controllers/UIInvoiceController.UI.cs index ad9b607f4..01fc7b3f8 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.UI.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.UI.cs @@ -671,7 +671,7 @@ namespace BTCPayServer.Controllers var displayedPaymentMethods = invoice.GetPaymentMethods().Select(p => p.GetId()).ToList(); // Exclude Lightning if OnChainWithLnInvoiceFallback is active and we have both payment methods - if (storeBlob is { CheckoutType: CheckoutType.V2, OnChainWithLnInvoiceFallback: true } && + if (storeBlob is { OnChainWithLnInvoiceFallback: true } && displayedPaymentMethods.Contains(btcId)) { displayedPaymentMethods.Remove(lnId); @@ -787,11 +787,13 @@ namespace BTCPayServer.Controllers Request.Host, Request.PathBase) : null; + var isAltcoinsBuild = false; +#if ALTCOINS + isAltcoinsBuild = true, +#endif + var model = new PaymentModel { -#if ALTCOINS - AltcoinsBuild = true, -#endif Activated = paymentMethodDetails.Activated, CryptoCode = network.CryptoCode, RootPath = Request.PathBase.Value.WithTrailingSlash(), @@ -856,12 +858,15 @@ namespace BTCPayServer.Controllers { var availableCryptoPaymentMethodId = kv.GetId(); var availableCryptoHandler = _paymentMethodHandlerDictionary[availableCryptoPaymentMethodId]; + var pmName = availableCryptoHandler.GetPaymentMethodName(availableCryptoPaymentMethodId); return new PaymentModel.AvailableCrypto { Displayed = displayedPaymentMethods.Contains(kv.GetId()), PaymentMethodId = kv.GetId().ToString(), CryptoCode = kv.Network?.CryptoCode ?? kv.GetId().CryptoCode, - PaymentMethodName = availableCryptoHandler.GetPaymentMethodName(availableCryptoPaymentMethodId), + PaymentMethodName = isAltcoinsBuild + ? pmName + : pmName.Replace("Bitcoin (", "").Replace(")", "").Replace("Lightning ", ""), IsLightning = kv.GetId().PaymentType == PaymentTypes.LightningLike, CryptoImage = Request.GetRelativePathOrAbsolute(availableCryptoHandler.GetCryptoImage(availableCryptoPaymentMethodId)), diff --git a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs index 3d1a62188..7afd6abf6 100644 --- a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs +++ b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs @@ -78,7 +78,6 @@ namespace BTCPayServer.Models.InvoicingModels public bool Activated { get; set; } public string InvoiceCurrency { get; set; } public string ReceiptLink { get; set; } - public bool AltcoinsBuild { get; set; } public CheckoutType CheckoutType { get; set; } public int? RequiredConfirmations { get; set; } public long? ReceivedConfirmations { get; set; } diff --git a/BTCPayServer/Views/UIInvoice/Checkout-Body.cshtml b/BTCPayServer/Views/UIInvoice/Checkout-Body.cshtml index bb0f7b842..670206c38 100644 --- a/BTCPayServer/Views/UIInvoice/Checkout-Body.cshtml +++ b/BTCPayServer/Views/UIInvoice/Checkout-Body.cshtml @@ -52,8 +52,7 @@