mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Run dotnet format
This commit is contained in:
@@ -74,7 +74,10 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
var result = await _PaymentRequestRepository.FindPaymentRequests(new PaymentRequestQuery()
|
||||
{
|
||||
UserId = GetUserId(), Skip = skip, Count = count, IncludeArchived = includeArchived
|
||||
UserId = GetUserId(),
|
||||
Skip = skip,
|
||||
Count = count,
|
||||
IncludeArchived = includeArchived
|
||||
});
|
||||
return View(new ListPaymentRequestsViewModel()
|
||||
{
|
||||
@@ -110,7 +113,7 @@ namespace BTCPayServer.Controllers
|
||||
return RedirectToAction("GetPaymentRequests");
|
||||
}
|
||||
|
||||
return View(nameof(EditPaymentRequest), new UpdatePaymentRequestViewModel(data) {Stores = stores});
|
||||
return View(nameof(EditPaymentRequest), new UpdatePaymentRequestViewModel(data) { Stores = stores });
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@@ -127,7 +130,7 @@ namespace BTCPayServer.Controllers
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
if ( data?.Archived is true && viewModel?.Archived is true)
|
||||
if (data?.Archived is true && viewModel?.Archived is true)
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, "You cannot edit an archived payment request.");
|
||||
}
|
||||
@@ -138,7 +141,7 @@ namespace BTCPayServer.Controllers
|
||||
nameof(StoreData.Id),
|
||||
nameof(StoreData.StoreName), data?.StoreDataId);
|
||||
|
||||
return View(nameof(EditPaymentRequest),viewModel);
|
||||
return View(nameof(EditPaymentRequest), viewModel);
|
||||
}
|
||||
|
||||
if (data == null)
|
||||
@@ -167,10 +170,10 @@ namespace BTCPayServer.Controllers
|
||||
}
|
||||
|
||||
data = await _PaymentRequestRepository.CreateOrUpdatePaymentRequest(data);
|
||||
_EventAggregator.Publish(new PaymentRequestUpdated() {Data = data, PaymentRequestId = data.Id,});
|
||||
_EventAggregator.Publish(new PaymentRequestUpdated() { Data = data, PaymentRequestId = data.Id, });
|
||||
|
||||
TempData[WellKnownTempData.SuccessMessage] = "Saved";
|
||||
return RedirectToAction(nameof(EditPaymentRequest), new {id = data.Id});
|
||||
return RedirectToAction(nameof(EditPaymentRequest), new { id = data.Id });
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
@@ -209,7 +212,7 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
if (redirectToInvoice)
|
||||
{
|
||||
return RedirectToAction("ViewPaymentRequest", new {Id = id});
|
||||
return RedirectToAction("ViewPaymentRequest", new { Id = id });
|
||||
}
|
||||
|
||||
return BadRequest("Payment Request cannot be paid as it has been archived");
|
||||
@@ -220,7 +223,7 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
if (redirectToInvoice)
|
||||
{
|
||||
return RedirectToAction("ViewPaymentRequest", new {Id = id});
|
||||
return RedirectToAction("ViewPaymentRequest", new { Id = id });
|
||||
}
|
||||
|
||||
return BadRequest("Payment Request has already been settled.");
|
||||
@@ -230,13 +233,13 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
if (redirectToInvoice)
|
||||
{
|
||||
return RedirectToAction("ViewPaymentRequest", new {Id = id});
|
||||
return RedirectToAction("ViewPaymentRequest", new { Id = id });
|
||||
}
|
||||
|
||||
return BadRequest("Payment Request has expired");
|
||||
}
|
||||
|
||||
var statusesAllowedToDisplay = new List<InvoiceStatus>() {InvoiceStatus.New};
|
||||
var statusesAllowedToDisplay = new List<InvoiceStatus>() { InvoiceStatus.New };
|
||||
var validInvoice = result.Invoices.FirstOrDefault(invoice =>
|
||||
Enum.TryParse<InvoiceStatus>(invoice.Status, true, out var status) &&
|
||||
statusesAllowedToDisplay.Contains(status));
|
||||
@@ -245,7 +248,7 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
if (redirectToInvoice)
|
||||
{
|
||||
return RedirectToAction("Checkout", "Invoice", new {Id = validInvoice.Id});
|
||||
return RedirectToAction("Checkout", "Invoice", new { Id = validInvoice.Id });
|
||||
}
|
||||
|
||||
return Ok(validInvoice.Id);
|
||||
@@ -264,21 +267,21 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
var redirectUrl = _linkGenerator.PaymentRequestLink(id, Request.Scheme, Request.Host, Request.PathBase);
|
||||
var newInvoiceId = (await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
|
||||
{
|
||||
OrderId = $"{PaymentRequestRepository.GetOrderIdForPaymentRequest(id)}",
|
||||
Currency = blob.Currency,
|
||||
Price = amount.Value,
|
||||
FullNotifications = true,
|
||||
BuyerEmail = result.Email,
|
||||
RedirectURL = redirectUrl,
|
||||
}, store, HttpContext.Request.GetAbsoluteRoot(),
|
||||
new List<string>() {PaymentRequestRepository.GetInternalTag(id)},
|
||||
{
|
||||
OrderId = $"{PaymentRequestRepository.GetOrderIdForPaymentRequest(id)}",
|
||||
Currency = blob.Currency,
|
||||
Price = amount.Value,
|
||||
FullNotifications = true,
|
||||
BuyerEmail = result.Email,
|
||||
RedirectURL = redirectUrl,
|
||||
}, store, HttpContext.Request.GetAbsoluteRoot(),
|
||||
new List<string>() { PaymentRequestRepository.GetInternalTag(id) },
|
||||
cancellationToken: cancellationToken))
|
||||
.Data.Id;
|
||||
|
||||
if (redirectToInvoice)
|
||||
{
|
||||
return RedirectToAction("Checkout", "Invoice", new {Id = newInvoiceId});
|
||||
return RedirectToAction("Checkout", "Invoice", new { Id = newInvoiceId });
|
||||
}
|
||||
|
||||
return Ok(newInvoiceId);
|
||||
@@ -315,7 +318,7 @@ namespace BTCPayServer.Controllers
|
||||
if (redirect)
|
||||
{
|
||||
TempData[WellKnownTempData.SuccessMessage] = "Payment cancelled";
|
||||
return RedirectToAction(nameof(ViewPaymentRequest), new {Id = id});
|
||||
return RedirectToAction(nameof(ViewPaymentRequest), new { Id = id });
|
||||
}
|
||||
|
||||
return Ok("Payment cancelled");
|
||||
|
||||
Reference in New Issue
Block a user