mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Disallow cancelling payment request when "Allow payee to create invoices in their own denomination" is not enabled (#2843)
* Disallow cancelling payment request when "Allow payee to create invoices in their own denomination" is not enabled close #2802 * Disallow cancelling pending invoice on BE * Update non-JS version of payment request view to disallow cancelling * Update CanCancelPaymentWhenPossible * Fix typo
This commit is contained in:
@@ -299,6 +299,10 @@ namespace BTCPayServer.Controllers
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
if (!result.AllowCustomPaymentAmounts) {
|
||||
return BadRequest("Not allowed to cancel this invoice");
|
||||
}
|
||||
|
||||
var invoices = result.Invoices.Where(requestInvoice =>
|
||||
requestInvoice.State.Status == InvoiceStatusLegacy.New && !requestInvoice.Payments.Any());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user