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:
Umar Bolatov
2021-09-16 18:24:48 -07:00
committed by GitHub
parent 603bd2692e
commit 5984edb7f4
3 changed files with 27 additions and 11 deletions

View File

@@ -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());