Removal of the Altcoins build (#6177)

* Remove some useless #if ALTCOINS

* Removal of the Altcoins build
This commit is contained in:
Nicolas Dorier
2024-08-30 08:34:23 +09:00
committed by GitHub
parent 25ccc6a9f9
commit a3cfb9e5e4
54 changed files with 23 additions and 292 deletions

View File

@@ -858,11 +858,6 @@ namespace BTCPayServer.Controllers
Request.Host,
Request.PathBase) : null;
var isAltcoinsBuild = false;
#if ALTCOINS
isAltcoinsBuild = true;
#endif
var orderId = invoice.Metadata.OrderId;
var supportUrl = !string.IsNullOrEmpty(storeBlob.StoreSupportUrl)
? storeBlob.StoreSupportUrl
@@ -870,11 +865,6 @@ namespace BTCPayServer.Controllers
.Replace("{InvoiceId}", Uri.EscapeDataString(invoice.Id))
: null;
string GetPaymentMethodName(PaymentMethodId paymentMethodId)
{
_paymentModelExtensions.TryGetValue(paymentMethodId, out var extension);
return extension?.DisplayName ?? paymentMethodId.ToString();
}
string GetPaymentMethodImage(PaymentMethodId paymentMethodId)
{
_paymentModelExtensions.TryGetValue(paymentMethodId, out var extension);
@@ -883,7 +873,7 @@ namespace BTCPayServer.Controllers
var model = new PaymentModel
{
Activated = prompt.Activated,
PaymentMethodName = GetPaymentMethodName(paymentMethodId),
PaymentMethodName = _prettyName.PrettyName(paymentMethodId),
CryptoCode = prompt.Currency,
RootPath = Request.PathBase.Value.WithTrailingSlash(),
OrderId = orderId,
@@ -939,15 +929,12 @@ namespace BTCPayServer.Controllers
.Select(kv =>
{
var handler = _handlers[kv.PaymentMethodId];
var pmName = GetPaymentMethodName(kv.PaymentMethodId);
return new PaymentModel.AvailableCrypto
{
Displayed = displayedPaymentMethods.Contains(kv.PaymentMethodId),
PaymentMethodId = kv.PaymentMethodId.ToString(),
CryptoCode = kv.Currency,
PaymentMethodName = isAltcoinsBuild
? pmName
: pmName.Replace("Bitcoin (", "").Replace(")", "").Replace("Lightning ", ""),
PaymentMethodName = _prettyName.PrettyName(kv.PaymentMethodId),
IsLightning = handler is ILightningPaymentHandler,
CryptoImage = Request.GetRelativePathOrAbsolute(GetPaymentMethodImage(kv.PaymentMethodId)),
Link = Url.Action(nameof(Checkout),