Store setting for allowing conversion through Shapeshift

This commit is contained in:
lepipele 2018-03-17 23:48:06 -05:00
parent d3befb5b86
commit c36a900627
4 changed files with 18 additions and 2 deletions

View file

@ -222,6 +222,7 @@ namespace BTCPayServer.Controllers
vm.InvoiceExpiration = storeBlob.InvoiceExpiration; vm.InvoiceExpiration = storeBlob.InvoiceExpiration;
vm.RateMultiplier = (double)storeBlob.GetRateMultiplier(); vm.RateMultiplier = (double)storeBlob.GetRateMultiplier();
vm.PreferredExchange = storeBlob.PreferredExchange.IsCoinAverage() ? "coinaverage" : storeBlob.PreferredExchange; vm.PreferredExchange = storeBlob.PreferredExchange.IsCoinAverage() ? "coinaverage" : storeBlob.PreferredExchange;
vm.AllowCoinConversion = storeBlob.AllowCoinConversion;
return View(vm); return View(vm);
} }
@ -298,6 +299,7 @@ namespace BTCPayServer.Controllers
blob.PreferredExchange = model.PreferredExchange; blob.PreferredExchange = model.PreferredExchange;
blob.SetRateMultiplier(model.RateMultiplier); blob.SetRateMultiplier(model.RateMultiplier);
blob.AllowCoinConversion = model.AllowCoinConversion;
if (store.SetStoreBlob(blob)) if (store.SetStoreBlob(blob))
{ {

View file

@ -213,6 +213,10 @@ namespace BTCPayServer.Data
{ {
get; set; get; set;
} }
public bool AllowCoinConversion
{
get; set;
}
[DefaultValue(60)] [DefaultValue(60)]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
public int MonitoringExpiration public int MonitoringExpiration

View file

@ -94,6 +94,12 @@ namespace BTCPayServer.Models.StoreViewModels
get; set; get; set;
} }
[Display(Name = "Allow conversion through third party (Shapeshift, Changelly...)")]
public bool AllowCoinConversion
{
get; set;
}
public string StatusMessage public string StatusMessage
{ {
get; set; get; set;

View file

@ -70,6 +70,10 @@
</select> </select>
<span asp-validation-for="SpeedPolicy" class="text-danger"></span> <span asp-validation-for="SpeedPolicy" class="text-danger"></span>
</div> </div>
<div class="form-group">
<label asp-for="AllowCoinConversion"></label>
<input asp-for="AllowCoinConversion" type="checkbox" class="form-check" />
</div>
<div class="form-group"> <div class="form-group">
<h5>Derivation Scheme</h5> <h5>Derivation Scheme</h5>
<span>The DerivationScheme represents the destination of the funds received by your invoice on chain.</span> <span>The DerivationScheme represents the destination of the funds received by your invoice on chain.</span>
@ -85,7 +89,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach(var scheme in Model.DerivationSchemes) @foreach (var scheme in Model.DerivationSchemes)
{ {
<tr> <tr>
<td>@scheme.Crypto</td> <td>@scheme.Crypto</td>
@ -114,7 +118,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach(var scheme in Model.LightningNodes) @foreach (var scheme in Model.LightningNodes)
{ {
<tr> <tr>
<td>@scheme.CryptoCode</td> <td>@scheme.CryptoCode</td>