Pay Button page foundation

This commit is contained in:
rockstardev
2018-08-10 20:26:51 +02:00
parent 86ca081030
commit e698d90e3c
6 changed files with 85 additions and 1 deletions

View File

@@ -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>

View File

@@ -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);
}
}
}

View File

@@ -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; } }
}

View 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; }
}
}

View File

@@ -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>

View 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>&nbsp;</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>