diff --git a/BTCPayServer/Controllers/AppsPublicController.cs b/BTCPayServer/Controllers/AppsPublicController.cs index 98c07d9fc..8f298946b 100644 --- a/BTCPayServer/Controllers/AppsPublicController.cs +++ b/BTCPayServer/Controllers/AppsPublicController.cs @@ -237,6 +237,10 @@ namespace BTCPayServer.Controllers [EnableCors(CorsPolicies.All)] public async Task ContributeToCrowdfund(string appId, ContributeToCrowdfund request, CancellationToken cancellationToken) { + if (request.Amount <= 0) + { + return NotFound("Please provide an amount greater than 0"); + } var app = await _AppService.GetApp(appId, AppType.Crowdfund, true); if (app == null) diff --git a/BTCPayServer/Controllers/PaymentRequestController.cs b/BTCPayServer/Controllers/PaymentRequestController.cs index 02f11d1f7..063dc6eb8 100644 --- a/BTCPayServer/Controllers/PaymentRequestController.cs +++ b/BTCPayServer/Controllers/PaymentRequestController.cs @@ -225,6 +225,10 @@ namespace BTCPayServer.Controllers public async Task PayPaymentRequest(string id, bool redirectToInvoice = true, decimal? amount = null, CancellationToken cancellationToken = default) { + if (amount.HasValue && amount.Value <= 0) + { + return BadRequest("Please provide an amount greater than 0"); + } var result = await _PaymentRequestService.GetPaymentRequest(id, GetUserId()); if (result == null) {