This commit is contained in:
Kukks
2024-04-11 15:10:57 +02:00
parent 71cb4c3f82
commit 215edd5b0a
18 changed files with 1352 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Abstractions.Extensions;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Abstractions.Services;
using BTCPayServer.HostedServices.Webhooks;
using BTCPayServer.Services.Apps;
using Microsoft.Extensions.DependencyInjection;
namespace BTCPayServer.Plugins.Subscriptions
{
public class SubscriptionPlugin : BaseBTCPayServerPlugin
{
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
[
new() {Identifier = nameof(BTCPayServer), Condition = ">=1.13.0"}
];
public override void Execute(IServiceCollection applicationBuilder)
{
applicationBuilder.AddSingleton<SubscriptionService>();
applicationBuilder.AddSingleton<IWebhookProvider>(o => o.GetRequiredService<SubscriptionService>());
applicationBuilder.AddHostedService(s => s.GetRequiredService<SubscriptionService>());
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("Subscriptions/NavExtension", "header-nav"));
applicationBuilder.AddSingleton<AppBaseType, SubscriptionApp>();
base.Execute(applicationBuilder);
}
}
}