mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Pay Button page foundation
This commit is contained in:
@@ -116,6 +116,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="Views\Apps\PayButton.cshtml">
|
||||
<Pack>$(IncludeRazorContentInPack)</Pack>
|
||||
</Content>
|
||||
<Content Update="Views\Server\LNDGRPCServices.cshtml">
|
||||
<Pack>$(IncludeRazorContentInPack)</Pack>
|
||||
</Content>
|
||||
|
||||
@@ -281,5 +281,12 @@ namespace BTCPayServer.Controllers
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("{appId}/paybutton")]
|
||||
public async Task<IActionResult> PayButton(string appId)
|
||||
{
|
||||
var model = new PayButtonViewModel();
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; } }
|
||||
}
|
||||
|
||||
18
BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs
Normal file
18
BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs
Normal file
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@
|
||||
@if (app.IsOwner)
|
||||
{
|
||||
<a asp-action="@app.UpdateAction" asp-controller="Apps" asp-route-appId="@app.Id">Settings</a><span> - </span>
|
||||
<a asp-action="paybutton" asp-controller="Apps" asp-route-appId="@app.Id">Pay Button</a><span> - </span>
|
||||
}
|
||||
<a asp-action="@app.ViewAction" asp-controller="Apps" asp-route-appId="@app.Id">View</a><span> - </span>
|
||||
<a asp-action="DeleteApp" asp-route-appId="@app.Id">Remove</a>
|
||||
|
||||
54
BTCPayServer/Views/Apps/PayButton.cshtml
Normal file
54
BTCPayServer/Views/Apps/PayButton.cshtml
Normal file
@@ -0,0 +1,54 @@
|
||||
@model PayButtonViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Pay Button";
|
||||
}
|
||||
|
||||
<section>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 text-center">
|
||||
<h2 class="section-heading">@ViewData["Title"]</h2>
|
||||
<hr class="primary">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 text-center">
|
||||
<partial name="_StatusMessage" for="@TempData["TempDataProperty-StatusMessage"]" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-8">
|
||||
<label>Price</label>
|
||||
<input type="email" class="form-control" id="inputEmail4">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label> </label>
|
||||
<input type="text" class="form-control" id="inputPassword4" value="USD">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Checkout Description</label>
|
||||
<input type="text" class="form-control" id="inputAddress" placeholder="(optional)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Button Size</label>
|
||||
<div style="vertical-align:top; font-size:12px; display:flex;">
|
||||
<button class="btn btn-default" style="width:95px;height:32px;margin-right:40px;">146 x 57 px</button>
|
||||
<button class="btn btn-default" style="width:126px;height:48px;margin-right:40px;">168 x 65 px</button>
|
||||
<button class="btn btn-default" style="width:146px;height:57px;">210 x 82 px</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<br />
|
||||
Define parameters that define the purchase: price, currency and then optional description of purchase.
|
||||
<br /><br />
|
||||
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.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user