Merge pull request #1630 from Kukks/public-endpoint-json

Pay endpoint: if JsonResponse is true, send error in json too
This commit is contained in:
Nicolas Dorier 2020-06-12 14:50:17 +09:00 committed by GitHub
commit 0b7d5c839a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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