Adding setting in checkout experience for inclusion of private route hints

This commit is contained in:
rockstardev 2020-05-19 16:26:03 -05:00
parent 5033cb3186
commit 33f63508e8
4 changed files with 13 additions and 1 deletions

View file

@ -381,6 +381,7 @@ namespace BTCPayServer.Controllers
vm.OnChainMinValue = storeBlob.OnChainMinValue?.ToString() ?? "";
vm.LightningMaxValue = storeBlob.LightningMaxValue?.ToString() ?? "";
vm.LightningAmountInSatoshi = storeBlob.LightningAmountInSatoshi;
vm.LightningPrivateRouteHints = storeBlob.LightningPrivateRouteHints;
vm.RedirectAutomatically = storeBlob.RedirectAutomatically;
return View(vm);
}
@ -441,6 +442,7 @@ namespace BTCPayServer.Controllers
blob.OnChainMinValue = onchainMinValue;
blob.LightningMaxValue = lightningMaxValue;
blob.LightningAmountInSatoshi = model.LightningAmountInSatoshi;
blob.LightningPrivateRouteHints = model.LightningPrivateRouteHints;
blob.RedirectAutomatically = model.RedirectAutomatically;
if (CurrentStore.SetStoreBlob(blob))
{

View file

@ -92,6 +92,7 @@ namespace BTCPayServer.Data
[JsonConverter(typeof(CurrencyValueJsonConverter))]
public CurrencyValue LightningMaxValue { get; set; }
public bool LightningAmountInSatoshi { get; set; }
public bool LightningPrivateRouteHints { get; set; }
public string CustomCSS { get; set; }
public string CustomLogo { get; set; }

View file

@ -64,6 +64,9 @@ namespace BTCPayServer.Models.StoreViewModels
[Display(Name = "Display lightning payment amounts in Satoshis")]
public bool LightningAmountInSatoshi { get; set; }
[Display(Name = "Add hop hints for private channels to the lightning invoice")]
public bool LightningPrivateRouteHints { get; set; }
[Display(Name = "Redirect invoice to redirect url automatically after paid")]
public bool RedirectAutomatically { get; set; }
}

View file

@ -81,6 +81,12 @@
<label asp-for="LightningAmountInSatoshi" class="form-check-label"></label>
<span asp-validation-for="LightningAmountInSatoshi" class="text-danger"></span>
</div>
<div class="form-check">
<input asp-for="LightningPrivateRouteHints" type="checkbox" class="form-check-input" />
<label asp-for="LightningPrivateRouteHints" class="form-check-label"></label>
<span asp-validation-for="LightningPrivateRouteHints" class="text-danger"></span>
</div>
<div class="form-check">
<input asp-for="RedirectAutomatically" type="checkbox" class="form-check-input" />
<label asp-for="RedirectAutomatically" class="form-check-label"></label>