mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Make sure the payment button does not error 500 if node not ready (Fix #1180)
This commit is contained in:
@@ -49,17 +49,27 @@ namespace BTCPayServer.Controllers
|
|||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return View();
|
return View();
|
||||||
|
|
||||||
var invoice = await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
|
DataWrapper<InvoiceResponse> invoice = null;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Price = model.Price,
|
invoice = await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
|
||||||
Currency = model.Currency,
|
{
|
||||||
ItemDesc = model.CheckoutDesc,
|
Price = model.Price,
|
||||||
OrderId = model.OrderId,
|
Currency = model.Currency,
|
||||||
NotificationEmail = model.NotifyEmail,
|
ItemDesc = model.CheckoutDesc,
|
||||||
NotificationURL = model.ServerIpn,
|
OrderId = model.OrderId,
|
||||||
RedirectURL = model.BrowserRedirect,
|
NotificationEmail = model.NotifyEmail,
|
||||||
FullNotifications = true
|
NotificationURL = model.ServerIpn,
|
||||||
}, store, HttpContext.Request.GetAbsoluteRoot(), cancellationToken: cancellationToken);
|
RedirectURL = model.BrowserRedirect,
|
||||||
|
FullNotifications = true
|
||||||
|
}, store, HttpContext.Request.GetAbsoluteRoot(), cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
catch (BitpayHttpException e)
|
||||||
|
{
|
||||||
|
ModelState.AddModelError("Store", e.Message);
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(model.CheckoutQueryString))
|
if (string.IsNullOrEmpty(model.CheckoutQueryString))
|
||||||
{
|
{
|
||||||
return Redirect(invoice.Data.Url);
|
return Redirect(invoice.Data.Url);
|
||||||
|
|||||||
Reference in New Issue
Block a user