mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
36 lines
1.6 KiB
Plaintext
36 lines
1.6 KiB
Plaintext
@using BTCPayServer.Plugins.SideShift
|
|
@inject SideShiftService SideShiftService
|
|
@model BTCPayServer.Models.InvoicingModels.PaymentModel
|
|
@{
|
|
const string id = "SideShift";
|
|
var settings = await SideShiftService.GetSideShiftForInvoice(Model.InvoiceId, Model.StoreId);
|
|
if (settings?.Enabled is true)
|
|
{
|
|
|
|
var coins = await SideShiftService.GetDepositOptions();
|
|
if (settings.ExplicitMethods?.Any() is true)
|
|
{
|
|
foreach (var explicitMethod in settings.ExplicitMethods)
|
|
{
|
|
var s = explicitMethod.Split("_");
|
|
var coin = s[0];
|
|
var network = s[1];
|
|
var coinInfo = coins.FirstOrDefault(c => c.CryptoCode == coin && c.Network == network);
|
|
if(coinInfo is null)
|
|
continue;
|
|
<a href="#@id" class="btcpay-pill m-0 payment-method" :class="{ active: pmId === '@id' && window.ssExplicitId === '@coinInfo.Id'}" v-on:click.prevent="()=>{ window.ssExplicitId = '@coinInfo.Id'; changePaymentMethod('@id'); }">
|
|
@coinInfo.DisplayName @(coinInfo.DisplayName.Equals(coinInfo.Network, StringComparison.InvariantCultureIgnoreCase)? string.Empty: $"({coinInfo.Network})")
|
|
</a>
|
|
}
|
|
}
|
|
if (!settings.OnlyShowExplicitMethods || settings.ExplicitMethods?.Any() is not true)
|
|
{
|
|
<a href="#@id" class="btcpay-pill m-0 payment-method" :class="{ active: pmId === '@id' && !window.ssExplicitId }" v-on:click.prevent="()=>{ window.ssExplicitId = null; changePaymentMethod('@id'); }">
|
|
@id
|
|
</a>
|
|
}
|
|
|
|
|
|
}
|
|
}
|