diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 983da5016..1d17e2be6 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -269,6 +269,7 @@ namespace BTCPayServer.Controllers (1m + (changelly.AmountMarkupPercentage / 100m))) : (decimal?)null; + var paymentMethodHandler = invoice.PaymentMethodHandlerDictionary[paymentMethodId]; var model = new PaymentModel() { CryptoCode = network.CryptoCode, @@ -279,6 +280,7 @@ namespace BTCPayServer.Controllers HtmlTitle = storeBlob.HtmlTitle ?? "BTCPay Invoice", CustomCSSLink = storeBlob.CustomCSS?.AbsoluteUri, CustomLogoLink = storeBlob.CustomLogo?.AbsoluteUri, + CryptoImage = Request.GetRelativePathOrAbsolute(paymentMethodHandler.GetCryptoImage(paymentMethodId)), LightningAmountInSatoshi = storeBlob.LightningAmountInSatoshi, BtcAddress = paymentMethodDetails.GetPaymentDestination(), BtcDue = accounting.Due.ToString(), @@ -324,7 +326,7 @@ namespace BTCPayServer.Controllers PaymentMethodName = availableCryptoHandler.GetPaymentMethodName(availableCryptoPaymentMethodId), IsLightning = kv.GetId().PaymentType == PaymentTypes.LightningLike, - CryptoImage = "/" + availableCryptoHandler.GetCryptoImage(availableCryptoPaymentMethodId), + CryptoImage = Request.GetRelativePathOrAbsolute(availableCryptoHandler.GetCryptoImage(availableCryptoPaymentMethodId)), Link = Url.Action(nameof(Checkout), new { @@ -337,7 +339,7 @@ namespace BTCPayServer.Controllers .ToList() }; - invoice.PaymentMethodHandlerDictionary[paymentMethod.GetId()].PreparePaymentModel(model, dto); + paymentMethodHandler.PreparePaymentModel(model, dto); model.PaymentMethodId = paymentMethodId.ToString(); var expiration = TimeSpan.FromSeconds(model.ExpirationSeconds); model.TimeLeft = expiration.PrettyPrint(); diff --git a/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs b/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs index 9159f7fc5..4ca7878a9 100644 --- a/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs +++ b/BTCPayServer/Payments/Bitcoin/BitcoinLikePaymentHandler.cs @@ -48,7 +48,6 @@ namespace BTCPayServer.Payments.Bitcoin var network = _networkProvider.GetNetwork(model.CryptoCode); model.IsLightning = false; model.PaymentMethodName = GetPaymentMethodName(network); - model.CryptoImage = "/" + GetCryptoImage(network); model.InvoiceBitcoinUrl = cryptoInfo.PaymentUrls.BIP21; model.InvoiceBitcoinUrlQR = cryptoInfo.PaymentUrls.BIP21; } diff --git a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs index e0bfda0bc..6da7e387d 100644 --- a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs +++ b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs @@ -207,7 +207,6 @@ namespace BTCPayServer.Payments.Lightning var network = _networkProvider.GetNetwork(model.CryptoCode); model.IsLightning = true; model.PaymentMethodName = GetPaymentMethodName(network); - model.CryptoImage = "/"+ GetCryptoImage(network); model.InvoiceBitcoinUrl = cryptoInfo.PaymentUrls.BOLT11; model.InvoiceBitcoinUrlQR = cryptoInfo.PaymentUrls.BOLT11.ToUpperInvariant(); }