#if ALTCOINS using System.Net; using System.Net.Http; using BTCPayServer.Abstractions.Contracts; using BTCPayServer.Abstractions.Services; using BTCPayServer.HostedServices; using BTCPayServer.Payments; using BTCPayServer.Services.Altcoins.Ethereum.Payments; using BTCPayServer.Services.Altcoins.Ethereum.Services; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace BTCPayServer.Services.Altcoins.Ethereum { public static class EthereumLikeExtensions { public const string EthereumInvoiceCheckHttpClient = "EthereumCheck"; public const string EthereumInvoiceCreateHttpClient = "EthereumCreate"; public static IServiceCollection AddEthereumLike(this IServiceCollection serviceCollection) { serviceCollection.AddSingleton(); serviceCollection.AddSingleton(provider => provider.GetService()); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(provider => provider.GetService()); serviceCollection.AddSingleton(new UIExtension("Ethereum/StoreNavEthereumExtension", "store-nav")); serviceCollection.AddTransient(); serviceCollection.AddSingleton(); serviceCollection.AddHttpClient(EthereumInvoiceCreateHttpClient) .ConfigurePrimaryHttpMessageHandler(); return serviceCollection; } } public class NoRedirectHttpClientHandler : HttpClientHandler { public NoRedirectHttpClientHandler() { this.AllowAutoRedirect = false; } } } #endif