mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
51690b47a3
* Automated Transfer processors This PR introduces a few things: * Payouts can now be directly nested under a store instead of through a pull payment. * The Wallet Send screen now has an option to "schedule" instead of simply creating a transaction. When you click on schedule, all transaction destinations are converted into approved payouts. Any options relating to fees or coin selection are discarded. * There is a new concept introduced, called "Transfer Processors". Transfer Processors are services for stores that process payouts that are awaiting payment. Each processor specifies which payment methods it can handle. BTCPay Server will have some forms of transfer processors baked in but it has been designed to allow the Plugin System to provide additional processors. * The initial transfer processors provided are "automated processors", for on chain and lightning payment methods. They can be configured to process payouts every X amount of minutes. For on-chain, this means payments are batched into one transaction, resulting in more efficient and cheaper fees for processing. * * fix build * extract * remove magic string stuff * fix error message when scheduling * Paginate migration * add payout count to payment method tab * remove unused var * add protip * optimzie payout migration dramatically * Remove useless double condition * Fix bunch of warnings * Remove warning * Remove warnigns * Rename to Payout processors * fix typo Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
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);
|
|
}
|
|
}
|