Modal option for Pay Button

closes #796
This commit is contained in:
Kukks
2020-02-28 16:01:44 +01:00
parent 18aaa1a0c4
commit c3bfce7656
4 changed files with 48 additions and 3 deletions

View File

@@ -37,7 +37,6 @@ namespace BTCPayServer.Controllers
[HttpPost]
[Route("api/v1/invoices")]
[MediaTypeAcceptConstraintAttribute("text/html")]
[IgnoreAntiforgeryToken]
[EnableCors(CorsPolicies.All)]
public async Task<IActionResult> PayButtonHandle([FromForm]PayButtonViewModel model, CancellationToken cancellationToken)
@@ -78,6 +77,15 @@ namespace BTCPayServer.Controllers
ModelState.AddModelError("Store", e.Message);
return View();
}
if (model.JsonResponse)
{
return Json(new
{
InvoiceId = invoice.Data.Id,
InvoiceUrl = invoice.Data.Url
});
}
if (string.IsNullOrEmpty(model.CheckoutQueryString))
{