mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
* Use Blazor for the Vault code * Put elements in different file * Controller abstraction * Break into VaultElement
33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
using BTCPayServer.Abstractions.Constants;
|
|
using BTCPayServer.Models;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BTCPayServer.Controllers
|
|
{
|
|
public partial class UIPullPaymentController
|
|
{
|
|
[AllowAnonymous]
|
|
[HttpGet("pull-payments/{pullPaymentId}/boltcard/{command}")]
|
|
public IActionResult SetupBoltcard(string pullPaymentId, string command)
|
|
{
|
|
return View(nameof(SetupBoltcard),
|
|
new SetupBoltcardViewModel
|
|
{
|
|
ReturnUrl = Url.Action(nameof(ViewPullPayment), "UIPullPayment", new { pullPaymentId }),
|
|
BoltcardUrl = Url.ActionAbsolute(this.Request, nameof(UIBoltcardController.GetWithdrawRequest), "UIBoltcard").AbsoluteUri,
|
|
NewCard = command == "configure-boltcard",
|
|
PullPaymentId = pullPaymentId
|
|
});
|
|
}
|
|
|
|
[AllowAnonymous]
|
|
[HttpPost("pull-payments/{pullPaymentId}/boltcard/{command}")]
|
|
public IActionResult SetupBoltcardPost(string pullPaymentId, string command)
|
|
{
|
|
TempData[WellKnownTempData.SuccessMessage] = StringLocalizer["Boltcard is configured"].Value;
|
|
return RedirectToAction(nameof(ViewPullPayment), new { pullPaymentId });
|
|
}
|
|
}
|
|
}
|