Rendering of Conversion tab on Invoice if enabled in store settings

This commit is contained in:
lepipele
2018-03-17 23:49:09 -05:00
parent c36a900627
commit 14b70ff35e
3 changed files with 39 additions and 26 deletions

View File

@@ -229,6 +229,7 @@ namespace BTCPayServer.Controllers
Status = invoice.Status,
CryptoImage = "/" + GetImage(paymentMethodId, network),
NetworkFeeDescription = $"{accounting.TxRequired} transaction{(accounting.TxRequired > 1 ? "s" : "")} x {paymentMethodDetails.GetTxFee()} {network.CryptoCode}",
AllowCoinConversion = store.GetStoreBlob().AllowCoinConversion,
AvailableCryptos = invoice.GetPaymentMethods(_NetworkProvider)
.Where(i => i.Network != null)
.Select(kv=> new PaymentModel.AvailableCrypto()

View File

@@ -43,5 +43,7 @@ namespace BTCPayServer.Models.InvoicingModels
public int MaxTimeMinutes { get; internal set; }
public string PaymentType { get; internal set; }
public string PaymentMethodId { get; internal set; }
public bool AllowCoinConversion { get; set; }
}
}

View File

@@ -170,10 +170,17 @@
<div class="payment-tabs__tab" id="copy-tab">
<span i18n="">Copy</span>
</div>
@if (Model.AllowCoinConversion)
{
<div class="payment-tabs__tab" id="altcoins-tab">
<span i18n="">Conversion</span>
</div>
<div id="tabsSlider" class="payment-tabs__slider three-tabs"></div>
}
else
{
<div id="tabsSlider" class="payment-tabs__slider"></div>
}
</div>
</div>
<div adjust-height="" class="payment-box">
@@ -262,6 +269,8 @@
</div>
</div>
</div>
@if (Model.AllowCoinConversion)
{
<div id="altcoins" class="bp-view payment manual-flow">
<div class="manual__step-two__instructions">
<span>
@@ -285,6 +294,7 @@
</a>*@
</center>
</div>
}
<div class="bp-view" id="link-expired" style="padding-top: 3.6rem;">
<div class="manual__step-one refund-address-form" novalidate="">
<div class="manual__step-one__header" i18n="">Link Expired</div>