diff --git a/BTCPayServer/Controllers/WalletsController.PullPayments.cs b/BTCPayServer/Controllers/WalletsController.PullPayments.cs index 6e50d7723..7f56f4cfb 100644 --- a/BTCPayServer/Controllers/WalletsController.PullPayments.cs +++ b/BTCPayServer/Controllers/WalletsController.PullPayments.cs @@ -30,7 +30,9 @@ namespace BTCPayServer.Controllers return View(new NewPullPaymentModel() { Name = "", - Currency = "BTC" + Currency = "BTC", + CustomCSSLink = "", + EmbeddedCSS = "", }); } @@ -65,7 +67,9 @@ namespace BTCPayServer.Controllers Amount = model.Amount, Currency = model.Currency, StoreId = walletId.StoreId, - PaymentMethodIds = new[] { paymentMethodId } + PaymentMethodIds = new[] { paymentMethodId }, + EmbeddedCSS = model.EmbeddedCSS, + CustomCSSLink = model.CustomCSSLink }); this.TempData.SetStatusMessageModel(new StatusMessageModel() { diff --git a/BTCPayServer/HostedServices/PullPaymentHostedService.cs b/BTCPayServer/HostedServices/PullPaymentHostedService.cs index 4f5ec876c..667a9b7ad 100644 --- a/BTCPayServer/HostedServices/PullPaymentHostedService.cs +++ b/BTCPayServer/HostedServices/PullPaymentHostedService.cs @@ -29,6 +29,8 @@ namespace BTCPayServer.HostedServices public string Name { get; set; } public decimal Amount { get; set; } public string Currency { get; set; } + public string CustomCSSLink { get; set; } + public string EmbeddedCSS { get; set; } public PaymentMethodId[] PaymentMethodIds { get; set; } public TimeSpan? Period { get; set; } } @@ -110,9 +112,9 @@ namespace BTCPayServer.HostedServices { Title = create.Name ?? string.Empty, Description = string.Empty, - CustomCSSLink = null, + CustomCSSLink = create.CustomCSSLink, Email = null, - EmbeddedCSS = null, + EmbeddedCSS = create.EmbeddedCSS, } }); ctx.PullPayments.Add(o); diff --git a/BTCPayServer/Models/WalletViewModels/PullPaymentsModel.cs b/BTCPayServer/Models/WalletViewModels/PullPaymentsModel.cs index 723c4411d..c8ca77303 100644 --- a/BTCPayServer/Models/WalletViewModels/PullPaymentsModel.cs +++ b/BTCPayServer/Models/WalletViewModels/PullPaymentsModel.cs @@ -42,5 +42,10 @@ namespace BTCPayServer.Models.WalletViewModels [Required] [ReadOnly(true)] public string Currency { get; set; } + [MaxLength(500)] + [Display(Name = "Custom bootstrap CSS file")] + public string CustomCSSLink { get; set; } + [Display(Name = "Custom CSS Code")] + public string EmbeddedCSS { get; set; } } } diff --git a/BTCPayServer/Views/Wallets/NewPullPayment.cshtml b/BTCPayServer/Views/Wallets/NewPullPayment.cshtml index 3ae87ab39..0b6de6c66 100644 --- a/BTCPayServer/Views/Wallets/NewPullPayment.cshtml +++ b/BTCPayServer/Views/Wallets/NewPullPayment.cshtml @@ -1,8 +1,7 @@ @model NewPullPaymentModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData["Title"] = "Manage pull payments"; - ViewData.SetActivePageAndTitle(WalletsNavPages.PullPayments); + ViewData["Title"] = "New pull payment"; }