This commit is contained in:
2023-07-27 19:05:45 +01:00
parent dfa9188146
commit 9053e3eb1f
4 changed files with 71 additions and 0 deletions

View File

@ -43,6 +43,7 @@ public class LndInvoicesStream : BackgroundService
{
using var scope = _scopeFactory.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<StreamerContext>();
var zapService = scope.ServiceProvider.GetRequiredService<ZapService>();
try
{
@ -56,6 +57,10 @@ public class LndInvoicesStream : BackgroundService
payment.IsPaid = true;
payment.User.Balance += (long)(payment.Amount * 1000L);
await db.SaveChangesAsync(stoppingToken);
if (!string.IsNullOrEmpty(payment.Nostr))
{
zapService.HandlePaid(payment.Invoice, payment.Nostr);
}
}
}
catch (Exception ex)