mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Errors not working in PointOfSale (#1141)
This commit is contained in:
@@ -165,26 +165,39 @@ namespace BTCPayServer.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var store = await _AppService.GetStore(app);
|
var store = await _AppService.GetStore(app);
|
||||||
var invoice = await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
|
try
|
||||||
{
|
{
|
||||||
ItemCode = choice?.Id,
|
var invoice = await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
|
||||||
ItemDesc = title,
|
{
|
||||||
Currency = settings.Currency,
|
ItemCode = choice?.Id,
|
||||||
Price = price,
|
ItemDesc = title,
|
||||||
BuyerEmail = email,
|
Currency = settings.Currency,
|
||||||
OrderId = orderId,
|
Price = price,
|
||||||
NotificationURL =
|
BuyerEmail = email,
|
||||||
string.IsNullOrEmpty(notificationUrl) ? settings.NotificationUrl : notificationUrl,
|
OrderId = orderId,
|
||||||
NotificationEmail = settings.NotificationEmail,
|
NotificationURL =
|
||||||
RedirectURL = redirectUrl ?? Request.GetDisplayUrl(),
|
string.IsNullOrEmpty(notificationUrl) ? settings.NotificationUrl : notificationUrl,
|
||||||
FullNotifications = true,
|
NotificationEmail = settings.NotificationEmail,
|
||||||
ExtendedNotifications = true,
|
RedirectURL = redirectUrl ?? Request.GetDisplayUrl(),
|
||||||
PosData = string.IsNullOrEmpty(posData) ? null : posData,
|
FullNotifications = true,
|
||||||
RedirectAutomatically = settings.RedirectAutomatically,
|
ExtendedNotifications = true,
|
||||||
}, store, HttpContext.Request.GetAbsoluteRoot(),
|
PosData = string.IsNullOrEmpty(posData) ? null : posData,
|
||||||
new List<string>() { AppService.GetAppInternalTag(appId) },
|
RedirectAutomatically = settings.RedirectAutomatically,
|
||||||
cancellationToken);
|
}, store, HttpContext.Request.GetAbsoluteRoot(),
|
||||||
return RedirectToAction(nameof(InvoiceController.Checkout), "Invoice", new { invoiceId = invoice.Data.Id });
|
new List<string>() { AppService.GetAppInternalTag(appId) },
|
||||||
|
cancellationToken);
|
||||||
|
return RedirectToAction(nameof(InvoiceController.Checkout), "Invoice", new { invoiceId = invoice.Data.Id });
|
||||||
|
}
|
||||||
|
catch (BitpayHttpException e)
|
||||||
|
{
|
||||||
|
TempData.SetStatusMessageModel(new StatusMessageModel()
|
||||||
|
{
|
||||||
|
Html = e.Message.Replace("\n", "<br />", StringComparison.OrdinalIgnoreCase),
|
||||||
|
Severity = StatusMessageModel.StatusSeverity.Error,
|
||||||
|
AllowDismiss = true
|
||||||
|
});
|
||||||
|
return RedirectToAction(nameof(ViewPointOfSale), new { appId = appId });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
|||||||
@@ -185,6 +185,10 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
@if (this.TempData.HasStatusMessage())
|
||||||
|
{
|
||||||
|
<partial name="_StatusMessage" />
|
||||||
|
}
|
||||||
|
|
||||||
@if (Model.EnableShoppingCart)
|
@if (Model.EnableShoppingCart)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user