diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 9d7c620a2..b57d04858 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -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() diff --git a/BTCPayServer/Controllers/StoresController.cs b/BTCPayServer/Controllers/StoresController.cs index 4e5a57824..9331dfab1 100644 --- a/BTCPayServer/Controllers/StoresController.cs +++ b/BTCPayServer/Controllers/StoresController.cs @@ -222,6 +222,7 @@ namespace BTCPayServer.Controllers vm.InvoiceExpiration = storeBlob.InvoiceExpiration; vm.RateMultiplier = (double)storeBlob.GetRateMultiplier(); vm.PreferredExchange = storeBlob.PreferredExchange.IsCoinAverage() ? "coinaverage" : storeBlob.PreferredExchange; + vm.AllowCoinConversion = storeBlob.AllowCoinConversion; return View(vm); } @@ -298,6 +299,7 @@ namespace BTCPayServer.Controllers blob.PreferredExchange = model.PreferredExchange; blob.SetRateMultiplier(model.RateMultiplier); + blob.AllowCoinConversion = model.AllowCoinConversion; if (store.SetStoreBlob(blob)) { diff --git a/BTCPayServer/Data/StoreData.cs b/BTCPayServer/Data/StoreData.cs index 020957db3..aec91dabf 100644 --- a/BTCPayServer/Data/StoreData.cs +++ b/BTCPayServer/Data/StoreData.cs @@ -213,6 +213,10 @@ namespace BTCPayServer.Data { get; set; } + public bool AllowCoinConversion + { + get; set; + } [DefaultValue(60)] [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int MonitoringExpiration diff --git a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs index 964871636..d82f16e74 100644 --- a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs +++ b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs @@ -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; } } } diff --git a/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs b/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs index 012132b55..0844ee874 100644 --- a/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs +++ b/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs @@ -94,6 +94,12 @@ namespace BTCPayServer.Models.StoreViewModels get; set; } + [Display(Name = "Allow conversion through third party (Shapeshift, Changelly...)")] + public bool AllowCoinConversion + { + get; set; + } + public string StatusMessage { get; set; diff --git a/BTCPayServer/Views/Invoice/Checkout.cshtml b/BTCPayServer/Views/Invoice/Checkout.cshtml index dec3105f2..1dad47bee 100644 --- a/BTCPayServer/Views/Invoice/Checkout.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout.cshtml @@ -170,23 +170,20 @@
+
+
+ @*Changelly doesn't have TO_AMOUNT support so we can't include it
+
+
+
+ *@
+