mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
@@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using BTCPayServer.Configuration;
|
||||||
using BTCPayServer.Data;
|
using BTCPayServer.Data;
|
||||||
using BTCPayServer.Filters;
|
using BTCPayServer.Filters;
|
||||||
using BTCPayServer.ModelBinders;
|
using BTCPayServer.ModelBinders;
|
||||||
@@ -33,15 +34,18 @@ namespace BTCPayServer.Controllers
|
|||||||
public class AppsPublicController : Controller
|
public class AppsPublicController : Controller
|
||||||
{
|
{
|
||||||
public AppsPublicController(AppService AppService,
|
public AppsPublicController(AppService AppService,
|
||||||
|
BTCPayServerOptions btcPayServerOptions,
|
||||||
InvoiceController invoiceController,
|
InvoiceController invoiceController,
|
||||||
UserManager<ApplicationUser> userManager)
|
UserManager<ApplicationUser> userManager)
|
||||||
{
|
{
|
||||||
_AppService = AppService;
|
_AppService = AppService;
|
||||||
|
_BtcPayServerOptions = btcPayServerOptions;
|
||||||
_InvoiceController = invoiceController;
|
_InvoiceController = invoiceController;
|
||||||
_UserManager = userManager;
|
_UserManager = userManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AppService _AppService;
|
private AppService _AppService;
|
||||||
|
private readonly BTCPayServerOptions _BtcPayServerOptions;
|
||||||
private InvoiceController _InvoiceController;
|
private InvoiceController _InvoiceController;
|
||||||
private readonly UserManager<ApplicationUser> _UserManager;
|
private readonly UserManager<ApplicationUser> _UserManager;
|
||||||
|
|
||||||
@@ -178,19 +182,22 @@ namespace BTCPayServer.Controllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var invoice = await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
|
var invoice = await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
|
||||||
{
|
{
|
||||||
OrderId = AppService.GetCrowdfundOrderId(appId),
|
OrderId = AppService.GetCrowdfundOrderId(appId),
|
||||||
Currency = settings.TargetCurrency,
|
Currency = settings.TargetCurrency,
|
||||||
ItemCode = request.ChoiceKey ?? string.Empty,
|
ItemCode = request.ChoiceKey ?? string.Empty,
|
||||||
ItemDesc = title,
|
ItemDesc = title,
|
||||||
BuyerEmail = request.Email,
|
BuyerEmail = request.Email,
|
||||||
Price = price,
|
Price = price,
|
||||||
NotificationURL = settings.NotificationUrl,
|
NotificationURL = settings.NotificationUrl,
|
||||||
NotificationEmail = settings.NotificationEmail,
|
NotificationEmail = settings.NotificationEmail,
|
||||||
FullNotifications = true,
|
FullNotifications = true,
|
||||||
ExtendedNotifications = true,
|
ExtendedNotifications = true,
|
||||||
RedirectURL = request.RedirectUrl ?? Request.GetDisplayUrl()
|
RedirectURL = request.RedirectUrl ??
|
||||||
}, store, HttpContext.Request.GetAbsoluteRoot(), new List<string> { AppService.GetAppInternalTag(appId) }, cancellationToken: cancellationToken);
|
new Uri(new Uri( new Uri(HttpContext.Request.GetAbsoluteRoot()), _BtcPayServerOptions.RootPath), $"apps/{appId}/crowdfund").ToString()
|
||||||
|
}, store, HttpContext.Request.GetAbsoluteRoot(),
|
||||||
|
new List<string> {AppService.GetAppInternalTag(appId)},
|
||||||
|
cancellationToken: cancellationToken);
|
||||||
if (request.RedirectToCheckout)
|
if (request.RedirectToCheckout)
|
||||||
{
|
{
|
||||||
return RedirectToAction(nameof(InvoiceController.Checkout), "Invoice",
|
return RedirectToAction(nameof(InvoiceController.Checkout), "Invoice",
|
||||||
|
|||||||
Reference in New Issue
Block a user