From 1d1c1141a35338dbdf2e128c15417f2f060ab61e Mon Sep 17 00:00:00 2001 From: Kukks Date: Wed, 3 Jun 2020 12:09:36 +0200 Subject: [PATCH] Pay endpoint: if JsonResponse is true, send error in json too fixes #1532 --- BTCPayServer/Controllers/PublicController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BTCPayServer/Controllers/PublicController.cs b/BTCPayServer/Controllers/PublicController.cs index c30259ccb..3d091d091 100644 --- a/BTCPayServer/Controllers/PublicController.cs +++ b/BTCPayServer/Controllers/PublicController.cs @@ -75,6 +75,11 @@ namespace BTCPayServer.Controllers catch (BitpayHttpException e) { ModelState.AddModelError("Store", e.Message); + if (model.JsonResponse) + { + return BadRequest(ModelState); + } + return View(); }