mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Merge pull request #731 from Kukks/coinswitch-shitcoin-tax
add coinswitch shitcoin tax
This commit is contained in:
commit
5b4b073fc8
7 changed files with 18 additions and 3 deletions
|
@ -333,6 +333,7 @@ namespace BTCPayServer.Controllers
|
||||||
ChangellyMerchantId = changelly?.ChangellyMerchantId,
|
ChangellyMerchantId = changelly?.ChangellyMerchantId,
|
||||||
ChangellyAmountDue = changellyAmountDue,
|
ChangellyAmountDue = changellyAmountDue,
|
||||||
CoinSwitchEnabled = coinswitch != null,
|
CoinSwitchEnabled = coinswitch != null,
|
||||||
|
CoinSwitchAmountMarkupPercentage = coinswitch?.AmountMarkupPercentage?? 0,
|
||||||
CoinSwitchMerchantId = coinswitch?.MerchantId,
|
CoinSwitchMerchantId = coinswitch?.MerchantId,
|
||||||
CoinSwitchMode = coinswitch?.Mode,
|
CoinSwitchMode = coinswitch?.Mode,
|
||||||
StoreId = store.Id,
|
StoreId = store.Id,
|
||||||
|
|
|
@ -28,6 +28,7 @@ namespace BTCPayServer.Controllers
|
||||||
vm.MerchantId = existing.MerchantId;
|
vm.MerchantId = existing.MerchantId;
|
||||||
vm.Enabled = existing.Enabled;
|
vm.Enabled = existing.Enabled;
|
||||||
vm.Mode = existing.Mode;
|
vm.Mode = existing.Mode;
|
||||||
|
vm.AmountMarkupPercentage = existing.AmountMarkupPercentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
@ -50,7 +51,8 @@ namespace BTCPayServer.Controllers
|
||||||
{
|
{
|
||||||
MerchantId = vm.MerchantId,
|
MerchantId = vm.MerchantId,
|
||||||
Enabled = vm.Enabled,
|
Enabled = vm.Enabled,
|
||||||
Mode = vm.Mode
|
Mode = vm.Mode,
|
||||||
|
AmountMarkupPercentage = vm.AmountMarkupPercentage
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (command)
|
switch (command)
|
||||||
|
|
|
@ -66,5 +66,6 @@ namespace BTCPayServer.Models.InvoicingModels
|
||||||
public string CoinSwitchMode { get; set; }
|
public string CoinSwitchMode { get; set; }
|
||||||
public string CoinSwitchMerchantId { get; set; }
|
public string CoinSwitchMerchantId { get; set; }
|
||||||
public string RootPath { get; set; }
|
public string RootPath { get; set; }
|
||||||
|
public decimal CoinSwitchAmountMarkupPercentage { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,12 @@ namespace BTCPayServer.Models.StoreViewModels
|
||||||
[Display(Name = "Integration Mode")]
|
[Display(Name = "Integration Mode")]
|
||||||
public string Mode { get; set; } = "inline";
|
public string Mode { get; set; } = "inline";
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Range(0, 100)]
|
||||||
|
[Display(Name =
|
||||||
|
"Percentage to multiply amount requested at Coinswitch to avoid underpaid situations due to Coinswitch not guaranteeing rates. ")]
|
||||||
|
public decimal AmountMarkupPercentage { get; set; } = new decimal(2);
|
||||||
|
|
||||||
public List<SelectListItem> Modes { get; } = new List<SelectListItem>
|
public List<SelectListItem> Modes { get; } = new List<SelectListItem>
|
||||||
{
|
{
|
||||||
new SelectListItem { Value = "popup", Text = "Open in a popup" },
|
new SelectListItem { Value = "popup", Text = "Open in a popup" },
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace BTCPayServer.Payments.CoinSwitch
|
||||||
public string MerchantId { get; set; }
|
public string MerchantId { get; set; }
|
||||||
public string Mode { get; set; }
|
public string Mode { get; set; }
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
|
public decimal AmountMarkupPercentage { get; set; }
|
||||||
|
|
||||||
public bool IsConfigured()
|
public bool IsConfigured()
|
||||||
{
|
{
|
||||||
|
|
|
@ -303,7 +303,7 @@
|
||||||
:mode="srvModel.coinSwitchMode"
|
:mode="srvModel.coinSwitchMode"
|
||||||
:merchant-id="srvModel.coinSwitchMerchantId"
|
:merchant-id="srvModel.coinSwitchMerchantId"
|
||||||
:to-currency="srvModel.paymentMethodId"
|
:to-currency="srvModel.paymentMethodId"
|
||||||
:to-currency-due="srvModel.btcDue"
|
:to-currency-due="srvModel.coinSwitchAmountMarkupPercentage? (1 + (srvModel.coinSwitchAmountMarkupPercentage / 100) :srvModel.btcDue"
|
||||||
:autoload="selectedThirdPartyProcessor === 'coinswitch'"
|
:autoload="selectedThirdPartyProcessor === 'coinswitch'"
|
||||||
:to-currency-address="srvModel.btcAddress">
|
:to-currency-address="srvModel.btcAddress">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -30,7 +30,11 @@
|
||||||
<select asp-for="Mode" asp-items="Model.Modes" class="form-control">
|
<select asp-for="Mode" asp-items="Model.Modes" class="form-control">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="AmountMarkupPercentage"></label>
|
||||||
|
<input asp-for="AmountMarkupPercentage" class="form-control"/>
|
||||||
|
<span asp-validation-for="AmountMarkupPercentage" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="Enabled"></label>
|
<label asp-for="Enabled"></label>
|
||||||
<input asp-for="Enabled" type="checkbox" class="form-check"/>
|
<input asp-for="Enabled" type="checkbox" class="form-check"/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue