Pay endpoint: if JsonResponse is true, send error in json too

fixes #1532
This commit is contained in:
Kukks 2020-06-03 12:09:36 +02:00
parent b9ef5af5d7
commit 1d1c1141a3

View File

@ -75,6 +75,11 @@ namespace BTCPayServer.Controllers
catch (BitpayHttpException e)
{
ModelState.AddModelError("Store", e.Message);
if (model.JsonResponse)
{
return BadRequest(ModelState);
}
return View();
}