Add ability to move a payout from InProgress to AwaitingPayment (#6564)

This commit is contained in:
Nicolas Dorier
2025-01-21 15:37:45 +09:00
committed by GitHub
parent 6180ee9b80
commit 01250f6aee
5 changed files with 80 additions and 47 deletions

View File

@@ -439,7 +439,28 @@ namespace BTCPayServer.Controllers
});
break;
}
case "mark-awaiting-payment":
await using (var context = _dbContextFactory.CreateContext())
{
var payouts = (await PullPaymentHostedService.GetPayouts(new PullPaymentHostedService.PayoutQuery()
{
States = new[] { PayoutState.InProgress },
Stores = new[] { storeId },
PayoutIds = payoutIds
}, context));
foreach (var payout in payouts)
{
payout.State = PayoutState.AwaitingPayment;
payout.Proof = null;
}
await context.SaveChangesAsync();
}
TempData.SetStatusMessageModel(new StatusMessageModel
{
Message = "Payout payments have been marked as awaiting payment",
Severity = StatusMessageModel.StatusSeverity.Success
});
break;
case "cancel":
await _pullPaymentService.Cancel(
new PullPaymentHostedService.CancelRequest(payoutIds, new[] { storeId }));