mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 06:35:13 +01:00
27 lines
1.2 KiB
C#
27 lines
1.2 KiB
C#
|
using BTCPayServer.Data.Data;
|
|||
|
using BTCPayServer.Payments;
|
|||
|
using BTCPayServer.PayoutProcessors.Lightning;
|
|||
|
using BTCPayServer.PayoutProcessors.OnChain;
|
|||
|
using Microsoft.Extensions.DependencyInjection;
|
|||
|
|
|||
|
namespace BTCPayServer.PayoutProcessors;
|
|||
|
|
|||
|
public static class PayoutProcessorsExtensions
|
|||
|
{
|
|||
|
public static void AddPayoutProcesors(this IServiceCollection serviceCollection)
|
|||
|
{
|
|||
|
serviceCollection.AddSingleton<OnChainAutomatedPayoutSenderFactory>();
|
|||
|
serviceCollection.AddSingleton<IPayoutProcessorFactory>(provider => provider.GetRequiredService<OnChainAutomatedPayoutSenderFactory>());
|
|||
|
serviceCollection.AddSingleton<LightningAutomatedPayoutSenderFactory>();
|
|||
|
serviceCollection.AddSingleton<IPayoutProcessorFactory>(provider => provider.GetRequiredService<LightningAutomatedPayoutSenderFactory>());
|
|||
|
serviceCollection.AddHostedService<PayoutProcessorService>();
|
|||
|
serviceCollection.AddSingleton<PayoutProcessorService>();
|
|||
|
serviceCollection.AddHostedService(s=> s.GetRequiredService<PayoutProcessorService>());
|
|||
|
}
|
|||
|
|
|||
|
public static PaymentMethodId GetPaymentMethodId(this PayoutProcessorData data)
|
|||
|
{
|
|||
|
return PaymentMethodId.Parse(data.PaymentMethod);
|
|||
|
}
|
|||
|
}
|