mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 10:30:47 +01:00
remove lnurl from crowdfund as per requests
This commit is contained in:
parent
cf747f1e07
commit
4eabe91cee
5 changed files with 4 additions and 91 deletions
|
@ -1797,34 +1797,6 @@ namespace BTCPayServer.Tests
|
||||||
Assert.True(payoutsData.All(p => p.State == PayoutState.Completed));
|
Assert.True(payoutsData.All(p => p.State == PayoutState.Completed));
|
||||||
});
|
});
|
||||||
|
|
||||||
//lnurl crowdfund support
|
|
||||||
s.GoToStore();
|
|
||||||
s.Driver.FindElement(By.Id("StoreNav-CreateApp")).Click();
|
|
||||||
s.Driver.FindElement(By.Name("AppName")).SendKeys("CF" + Guid.NewGuid());
|
|
||||||
s.Driver.FindElement(By.Id("SelectedAppType")).SendKeys("Crowdfund");
|
|
||||||
s.Driver.FindElement(By.Id("Create")).Click();
|
|
||||||
Assert.Contains("App successfully created", s.FindAlertMessage().Text);
|
|
||||||
|
|
||||||
s.Driver.FindElement(By.Id("Title")).SendKeys("Kukkstarter");
|
|
||||||
s.Driver.FindElement(By.CssSelector("div.note-editable.card-block")).SendKeys("1BTC = 1BTC");
|
|
||||||
s.Driver.FindElement(By.Id("SaveSettings")).Click();
|
|
||||||
Assert.Contains("App updated", s.FindAlertMessage().Text);
|
|
||||||
|
|
||||||
s.Driver.FindElement(By.Id("ViewApp")).Click();
|
|
||||||
|
|
||||||
var windows = s.Driver.WindowHandles;
|
|
||||||
Assert.Equal(2, windows.Count);
|
|
||||||
s.Driver.SwitchTo().Window(windows[1]);
|
|
||||||
|
|
||||||
s.Driver.FindElement(By.CssSelector("#crowdfund-body-contribution-container .perk")).Click();
|
|
||||||
s.Driver.FindElement(By.PartialLinkText("LNURL")).Click();
|
|
||||||
lnurl = s.Driver.FindElement(By.ClassName("lnurl"))
|
|
||||||
.GetAttribute("href");
|
|
||||||
|
|
||||||
LNURL.LNURL.Parse(lnurl, out tag);
|
|
||||||
|
|
||||||
s.Driver.Close();
|
|
||||||
s.Driver.SwitchTo().Window(windows[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
@ -359,8 +359,7 @@ namespace BTCPayServer.Hosting
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("LNURL/LightningAddressNav",
|
services.AddSingleton<IUIExtension>(new UIExtension("LNURL/LightningAddressNav",
|
||||||
"store-integrations-nav"));
|
"store-integrations-nav"));
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("LNURL/LightningAddressOption",
|
services.AddSingleton<IUIExtension>(new UIExtension("LNURL/LightningAddressOption",
|
||||||
"store-integrations-list"));services.AddSingleton<IUIExtension>(new UIExtension("LNURL/CrowdfundLNURL",
|
"store-integrations-list"));
|
||||||
"crowdfund-head"));
|
|
||||||
services.AddSingleton<IHostedService, LightningListener>();
|
services.AddSingleton<IHostedService, LightningListener>();
|
||||||
|
|
||||||
services.AddSingleton<PaymentMethodHandlerDictionary>();
|
services.AddSingleton<PaymentMethodHandlerDictionary>();
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
@using BTCPayServer.Services.Stores
|
|
||||||
@using BTCPayServer.Payments.Lightning
|
|
||||||
@using BTCPayServer.Abstractions.Extensions
|
|
||||||
@model BTCPayServer.Models.AppViewModels.ViewCrowdfundViewModel
|
|
||||||
@inject BTCPayNetworkProvider BTCPayNetworkProvider
|
|
||||||
@inject StoreRepository StoreRepository
|
|
||||||
@{
|
|
||||||
Context.Request.Query.TryGetValue("cryptocode", out var cryptoCodeValues);
|
|
||||||
var cryptoCode = cryptoCodeValues.FirstOrDefault() ?? "BTC";
|
|
||||||
|
|
||||||
var store = await StoreRepository.FindStore(Model.StoreId);
|
|
||||||
var supported = store.GetSupportedPaymentMethods(BTCPayNetworkProvider).OfType<LNURLPaySupportedPaymentMethod>().FirstOrDefault(method => method.CryptoCode == cryptoCode);
|
|
||||||
if (supported != null && !store.GetEnabledPaymentIds(BTCPayNetworkProvider).Contains(supported.PaymentId))
|
|
||||||
{
|
|
||||||
supported = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supported != null)
|
|
||||||
{
|
|
||||||
var lnurls = Model.Perks.Select(item => (item.Id, LNURL.LNURL.EncodeUri(new Uri(Context.Request.GetAbsoluteUri(Url.Action("GetLNURLForApp", "UILNURL", new
|
|
||||||
{
|
|
||||||
cryptoCode = supported.CryptoCode,
|
|
||||||
appid = Model.AppId,
|
|
||||||
ItemCode = item.Id
|
|
||||||
}))), "payRequest", supported.UseBech32Scheme))).ToDictionary(tuple => tuple.Id, tuple => tuple.Item2);
|
|
||||||
lnurls.Add("", LNURL.LNURL.EncodeUri(new Uri(Context.Request.GetAbsoluteUri(Url.Action("GetLNURLForApp", "UILNURL", new
|
|
||||||
{
|
|
||||||
cryptoCode = supported.CryptoCode,
|
|
||||||
appid = Model.AppId,
|
|
||||||
}))), "payRequest", supported.UseBech32Scheme));
|
|
||||||
<script>
|
|
||||||
window.lnurl = true;
|
|
||||||
window.lnurlItems = @Safe.Json(lnurls);
|
|
||||||
</script>
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -345,28 +345,8 @@
|
||||||
</div>
|
</div>
|
||||||
<p class="card-text overflow-hidden" v-if="perk.description" v-html="perk.description"></p>
|
<p class="card-text overflow-hidden" v-if="perk.description" v-html="perk.description"></p>
|
||||||
|
|
||||||
<ul class="nav justify-content-center text-dark my-2" v-if="expanded && lnurl">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link"
|
|
||||||
v-bind:class="{ 'active': 'standard' == currentMode}" href="#" v-on:click="currentMode = 'standard'">
|
|
||||||
Standard
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link"
|
|
||||||
v-bind:class="{ 'active': 'lnurl' == currentMode}" href="#" v-on:click="currentMode = 'lnurl'">
|
|
||||||
LNURL
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="d-flex flex-column align-items-center" style="max-width:500px;" v-if="expanded && 'lnurl' == currentMode" :id="'perk-form'+ perk.id">
|
|
||||||
<qrcode class="rounded-2" style="width:256px; height: 256px;" v-bind:value="lnurlItems[perk.id??'']" :options="{ width: 256, margin: 1, color: {dark:'#000', light:'#f5f5f7'} }"></qrcode>
|
|
||||||
<a :href="lnurlItems[perk.id??'']" class="btn btn-secondary d-print-none mt-3 lnurl" style="width:256px;" rel="noreferrer noopener">
|
|
||||||
Open in wallet
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-group" style="max-width:500px;" v-else-if="expanded && 'standard' == currentMode" :id="'perk-form'+ perk.id">
|
<div class="input-group" style="max-width:500px;" v-else-if="expanded" :id="'perk-form'+ perk.id">
|
||||||
<input
|
<input
|
||||||
v-if="perk.price.type !== 0"
|
v-if="perk.price.type !== 0"
|
||||||
:disabled="!active"
|
:disabled="!active"
|
||||||
|
|
|
@ -23,9 +23,7 @@ document.addEventListener("DOMContentLoaded",function (ev) {
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
amount: null,
|
amount: null,
|
||||||
expanded: false,
|
expanded: false
|
||||||
lnurl: window.lnurl,
|
|
||||||
currentMode: 'standard'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue