diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 7646faf9d..fd634b3dd 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -116,6 +116,9 @@ + + $(IncludeRazorContentInPack) + $(IncludeRazorContentInPack) diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/AppsController.PointOfSale.cs index 078f671f9..6f24e1d53 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/AppsController.PointOfSale.cs @@ -163,7 +163,7 @@ namespace BTCPayServer.Controllers using (var ctx = _ContextFactory.CreateContext()) { return await ctx.Apps - .Where(us => us.Id == appId && + .Where(us => us.Id == appId && us.AppType == appType.ToString()) .FirstOrDefaultAsync(); } @@ -281,5 +281,12 @@ namespace BTCPayServer.Controllers await ctx.SaveChangesAsync(); } } + + [Route("{appId}/paybutton")] + public async Task PayButton(string appId) + { + var model = new PayButtonViewModel(); + return View(model); + } } } diff --git a/BTCPayServer/Models/AppViewModels/ListAppsViewModel.cs b/BTCPayServer/Models/AppViewModels/ListAppsViewModel.cs index be8317c03..5ad7624ff 100644 --- a/BTCPayServer/Models/AppViewModels/ListAppsViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/ListAppsViewModel.cs @@ -15,6 +15,7 @@ namespace BTCPayServer.Models.AppViewModels public string AppName { get; set; } public string AppType { get; set; } public bool IsOwner { get; set; } + public string UpdateAction { get { return "Update" + AppType; } } public string ViewAction { get { return "View" + AppType; } } } diff --git a/BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs b/BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs new file mode 100644 index 000000000..8b2be3c12 --- /dev/null +++ b/BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BTCPayServer.Models.AppViewModels +{ + public class PayButtonViewModel + { + public decimal Price { get; set; } + public string Currency { get; set; } + public string CheckoutDesc { get; set; } + public int ButtonSize { get; set; } + public string ServerIpn { get; set; } + public string BrowserRedirect { get; set; } + public string EmailToNotify { get; set; } + } +} diff --git a/BTCPayServer/Views/Apps/ListApps.cshtml b/BTCPayServer/Views/Apps/ListApps.cshtml index df549a520..773372650 100644 --- a/BTCPayServer/Views/Apps/ListApps.cshtml +++ b/BTCPayServer/Views/Apps/ListApps.cshtml @@ -51,6 +51,7 @@ @if (app.IsOwner) { Settings - + Pay Button - } View - Remove diff --git a/BTCPayServer/Views/Apps/PayButton.cshtml b/BTCPayServer/Views/Apps/PayButton.cshtml new file mode 100644 index 000000000..93d050996 --- /dev/null +++ b/BTCPayServer/Views/Apps/PayButton.cshtml @@ -0,0 +1,54 @@ +@model PayButtonViewModel +@{ + ViewData["Title"] = "Pay Button"; +} + +
+
+
+
+

@ViewData["Title"]

+
+
+
+
+
+ +
+
+
+
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+ + + +
+
+
+
+
+ Define parameters that define the purchase: price, currency and then optional description of purchase. +

+ Generated HTML will be displayed at the bottom of this page and all you need is to paste that HTML into your final page. + Clicking on the button will redirect customer to checkout. +
+
+
+