mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
Rename WebhookNotificationManager -> WebhookSender
This commit is contained in:
parent
cb295e20d4
commit
6999abe1ca
@ -26,14 +26,14 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
[EnableCors(CorsPolicies.All)]
|
||||
public class StoreWebhooksController : ControllerBase
|
||||
{
|
||||
public StoreWebhooksController(StoreRepository storeRepository, WebhookNotificationManager webhookNotificationManager)
|
||||
public StoreWebhooksController(StoreRepository storeRepository, WebhookSender webhookNotificationManager)
|
||||
{
|
||||
StoreRepository = storeRepository;
|
||||
WebhookNotificationManager = webhookNotificationManager;
|
||||
}
|
||||
|
||||
public StoreRepository StoreRepository { get; }
|
||||
public WebhookNotificationManager WebhookNotificationManager { get; }
|
||||
public WebhookSender WebhookNotificationManager { get; }
|
||||
|
||||
[HttpGet("~/api/v1/stores/{storeId}/webhooks/{webhookId?}")]
|
||||
public async Task<IActionResult> ListWebhooks(string storeId, string webhookId)
|
||||
|
@ -43,7 +43,7 @@ namespace BTCPayServer.Controllers
|
||||
private readonly PullPaymentHostedService _paymentHostedService;
|
||||
private readonly LanguageService _languageService;
|
||||
|
||||
public WebhookNotificationManager WebhookNotificationManager { get; }
|
||||
public WebhookSender WebhookNotificationManager { get; }
|
||||
|
||||
public InvoiceController(
|
||||
InvoiceRepository invoiceRepository,
|
||||
@ -57,7 +57,7 @@ namespace BTCPayServer.Controllers
|
||||
PaymentMethodHandlerDictionary paymentMethodHandlerDictionary,
|
||||
ApplicationDbContextFactory dbContextFactory,
|
||||
PullPaymentHostedService paymentHostedService,
|
||||
WebhookNotificationManager webhookNotificationManager,
|
||||
WebhookSender webhookNotificationManager,
|
||||
LanguageService languageService)
|
||||
{
|
||||
_CurrencyNameTable = currencyNameTable ?? throw new ArgumentNullException(nameof(currencyNameTable));
|
||||
|
@ -58,7 +58,7 @@ namespace BTCPayServer.Controllers
|
||||
IAuthorizationService authorizationService,
|
||||
EventAggregator eventAggregator,
|
||||
AppService appService,
|
||||
WebhookNotificationManager webhookNotificationManager,
|
||||
WebhookSender webhookNotificationManager,
|
||||
IDataProtectionProvider dataProtector,
|
||||
NBXplorerDashboard Dashboard)
|
||||
{
|
||||
@ -818,7 +818,7 @@ namespace BTCPayServer.Controllers
|
||||
}
|
||||
|
||||
public string GeneratedPairingCode { get; set; }
|
||||
public WebhookNotificationManager WebhookNotificationManager { get; }
|
||||
public WebhookSender WebhookNotificationManager { get; }
|
||||
public IDataProtector DataProtector { get; }
|
||||
|
||||
[HttpGet]
|
||||
|
@ -33,7 +33,7 @@ namespace BTCPayServer.Data
|
||||
public byte[] Request { get; set; }
|
||||
public T ReadRequestAs<T>()
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(UTF8Encoding.UTF8.GetString(Request), HostedServices.WebhookNotificationManager.DefaultSerializerSettings);
|
||||
return JsonConvert.DeserializeObject<T>(UTF8Encoding.UTF8.GetString(Request), HostedServices.WebhookSender.DefaultSerializerSettings);
|
||||
}
|
||||
}
|
||||
public class WebhookBlob
|
||||
@ -56,11 +56,11 @@ namespace BTCPayServer.Data
|
||||
}
|
||||
public static WebhookDeliveryBlob GetBlob(this WebhookDeliveryData webhook)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<WebhookDeliveryBlob>(ZipUtils.Unzip(webhook.Blob), HostedServices.WebhookNotificationManager.DefaultSerializerSettings);
|
||||
return JsonConvert.DeserializeObject<WebhookDeliveryBlob>(ZipUtils.Unzip(webhook.Blob), HostedServices.WebhookSender.DefaultSerializerSettings);
|
||||
}
|
||||
public static void SetBlob(this WebhookDeliveryData webhook, WebhookDeliveryBlob blob)
|
||||
{
|
||||
webhook.Blob = ZipUtils.Zip(JsonConvert.SerializeObject(blob, Formatting.None, HostedServices.WebhookNotificationManager.DefaultSerializerSettings));
|
||||
webhook.Blob = ZipUtils.Zip(JsonConvert.SerializeObject(blob, Formatting.None, HostedServices.WebhookSender.DefaultSerializerSettings));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,11 +27,11 @@ namespace BTCPayServer.HostedServices
|
||||
/// This class send webhook notifications
|
||||
/// It also make sure the events sent to a webhook are sent in order to the webhook
|
||||
/// </summary>
|
||||
public class WebhookNotificationManager : EventHostedServiceBase
|
||||
public class WebhookSender : EventHostedServiceBase
|
||||
{
|
||||
readonly Encoding UTF8 = new UTF8Encoding(false);
|
||||
public readonly static JsonSerializerSettings DefaultSerializerSettings;
|
||||
static WebhookNotificationManager()
|
||||
static WebhookSender()
|
||||
{
|
||||
DefaultSerializerSettings = WebhookEvent.DefaultSerializerSettings;
|
||||
}
|
||||
@ -60,7 +60,7 @@ namespace BTCPayServer.HostedServices
|
||||
public StoreRepository StoreRepository { get; }
|
||||
public IHttpClientFactory HttpClientFactory { get; }
|
||||
|
||||
public WebhookNotificationManager(EventAggregator eventAggregator,
|
||||
public WebhookSender(EventAggregator eventAggregator,
|
||||
StoreRepository storeRepository,
|
||||
IHttpClientFactory httpClientFactory,
|
||||
Logs logs) : base(eventAggregator, logs)
|
@ -307,9 +307,9 @@ namespace BTCPayServer.Hosting
|
||||
|
||||
services.AddSingleton<HostedServices.CheckConfigurationHostedService>();
|
||||
services.AddSingleton<IHostedService, HostedServices.CheckConfigurationHostedService>(o => o.GetRequiredService<CheckConfigurationHostedService>());
|
||||
services.AddSingleton<HostedServices.WebhookNotificationManager>();
|
||||
services.AddSingleton<IHostedService, WebhookNotificationManager>(o => o.GetRequiredService<WebhookNotificationManager>());
|
||||
services.AddHttpClient(WebhookNotificationManager.OnionNamedClient)
|
||||
services.AddSingleton<HostedServices.WebhookSender>();
|
||||
services.AddSingleton<IHostedService, WebhookSender>(o => o.GetRequiredService<WebhookSender>());
|
||||
services.AddHttpClient(WebhookSender.OnionNamedClient)
|
||||
.ConfigurePrimaryHttpMessageHandler<Socks5HttpClientHandler>();
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user