mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-24 01:14:20 +01:00
Accept all success HTTP code for invoice callbacks
This commit is contained in:
@@ -75,7 +75,8 @@ namespace BTCPayServer.HostedServices
|
|||||||
if (string.IsNullOrEmpty(invoice.NotificationURL))
|
if (string.IsNullOrEmpty(invoice.NotificationURL))
|
||||||
return;
|
return;
|
||||||
_EventAggregator.Publish<InvoiceIPNEvent>(new InvoiceIPNEvent(invoice.Id, eventCode, name));
|
_EventAggregator.Publish<InvoiceIPNEvent>(new InvoiceIPNEvent(invoice.Id, eventCode, name));
|
||||||
await SendNotification(invoice, eventCode, name, cts.Token);
|
var response = await SendNotification(invoice, eventCode, name, cts.Token);
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException) when (cts.IsCancellationRequested)
|
catch (OperationCanceledException) when (cts.IsCancellationRequested)
|
||||||
@@ -112,7 +113,7 @@ namespace BTCPayServer.HostedServices
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
HttpResponseMessage response = await SendNotification(job.Invoice, job.EventCode, job.Message, cts.Token);
|
HttpResponseMessage response = await SendNotification(job.Invoice, job.EventCode, job.Message, cts.Token);
|
||||||
reschedule = response.StatusCode != System.Net.HttpStatusCode.OK;
|
reschedule = !response.IsSuccessStatusCode;
|
||||||
Logger.LogInformation("Job " + jobId + " returned " + response.StatusCode);
|
Logger.LogInformation("Job " + jobId + " returned " + response.StatusCode);
|
||||||
|
|
||||||
_EventAggregator.Publish<InvoiceIPNEvent>(new InvoiceIPNEvent(job.Invoice.Id, job.EventCode, job.Message)
|
_EventAggregator.Publish<InvoiceIPNEvent>(new InvoiceIPNEvent(job.Invoice.Id, job.EventCode, job.Message)
|
||||||
|
|||||||
Reference in New Issue
Block a user