mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-24 08:24:29 +01:00
fixes #5208
This commit is contained in:
@@ -203,6 +203,9 @@ public class UIFormsController : Controller
|
||||
if (store is null)
|
||||
return NotFound();
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
var request = _formDataService.GenerateInvoiceParametersFromForm(form);
|
||||
var inv = await invoiceController.CreateInvoiceCoreRaw(request, store, Request.GetAbsoluteRoot());
|
||||
if (inv.Price == 0 && inv.Type == InvoiceType.Standard && inv.ReceiptOptions?.Enabled is not false)
|
||||
@@ -210,5 +213,15 @@ public class UIFormsController : Controller
|
||||
return RedirectToAction("InvoiceReceipt", "UIInvoice", new { invoiceId = inv.Id });
|
||||
}
|
||||
return RedirectToAction("Checkout", "UIInvoice", new { invoiceId = inv.Id });
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TempData.SetStatusMessageModel(new StatusMessageModel()
|
||||
{
|
||||
Severity = StatusMessageModel.StatusSeverity.Error,
|
||||
Message = "Could not generate invoice: "+ e.Message
|
||||
});
|
||||
return await GetFormView(formData, form);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user