mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 01:43:50 +01:00
Rename more legacy fields
This commit is contained in:
parent
968223a953
commit
68f24e47cd
@ -322,7 +322,7 @@ namespace BTCPayServer.Tests
|
||||
var checkout =
|
||||
(Models.InvoicingModels.CheckoutModel)((JsonResult)controller.GetStatus(invoice.Id)
|
||||
.GetAwaiter().GetResult()).Value;
|
||||
Assert.Single(checkout.AvailableCryptos);
|
||||
Assert.Single(checkout.AvailablePaymentMethods);
|
||||
Assert.Equal("LTC", checkout.PaymentMethodCurrency);
|
||||
|
||||
//////////////////////
|
||||
@ -477,7 +477,7 @@ namespace BTCPayServer.Tests
|
||||
var checkout =
|
||||
(Models.InvoicingModels.CheckoutModel)((JsonResult)controller.GetStatus(invoice.Id, null)
|
||||
.GetAwaiter().GetResult()).Value;
|
||||
Assert.Single(checkout.AvailableCryptos);
|
||||
Assert.Single(checkout.AvailablePaymentMethods);
|
||||
Assert.Equal("BTC", checkout.PaymentMethodCurrency);
|
||||
|
||||
Assert.Single(invoice.PaymentCodes);
|
||||
@ -538,7 +538,7 @@ namespace BTCPayServer.Tests
|
||||
controller = tester.PayTester.GetController<UIInvoiceController>(null);
|
||||
checkout = (Models.InvoicingModels.CheckoutModel)((JsonResult)controller.GetStatus(invoice.Id, "LTC")
|
||||
.GetAwaiter().GetResult()).Value;
|
||||
Assert.Equal(2, checkout.AvailableCryptos.Count);
|
||||
Assert.Equal(2, checkout.AvailablePaymentMethods.Count);
|
||||
Assert.Equal("LTC", checkout.PaymentMethodCurrency);
|
||||
|
||||
Assert.Equal(2, invoice.PaymentCodes.Count());
|
||||
|
@ -910,11 +910,11 @@ namespace BTCPayServer.Controllers
|
||||
// The Tweak is part of the PaymentMethodFee, but let's not show it in the UI as it's negligible.
|
||||
NetworkFee = prompt.PaymentMethodFee - prompt.TweakFee,
|
||||
StoreId = store.Id,
|
||||
AvailableCryptos = invoice.GetPaymentPrompts()
|
||||
AvailablePaymentMethods = invoice.GetPaymentPrompts()
|
||||
.Select(kv =>
|
||||
{
|
||||
var handler = _handlers[kv.PaymentMethodId];
|
||||
return new CheckoutModel.AvailableCrypto
|
||||
return new CheckoutModel.AvailablePaymentMethod
|
||||
{
|
||||
Displayed = displayedPaymentMethods.Contains(kv.PaymentMethodId),
|
||||
PaymentMethodId = kv.PaymentMethodId,
|
||||
|
@ -10,7 +10,7 @@ namespace BTCPayServer.Models.InvoicingModels
|
||||
public class CheckoutModel
|
||||
{
|
||||
public string CheckoutBodyComponentName { get; set; }
|
||||
public class AvailableCrypto
|
||||
public class AvailablePaymentMethod
|
||||
{
|
||||
[JsonConverter(typeof(PaymentMethodIdJsonConverter))]
|
||||
public PaymentMethodId PaymentMethodId { get; set; }
|
||||
@ -29,7 +29,7 @@ namespace BTCPayServer.Models.InvoicingModels
|
||||
public string DefaultLang { get; set; }
|
||||
public bool ShowPayInWalletButton { get; set; }
|
||||
public bool ShowStoreHeader { get; set; }
|
||||
public List<AvailableCrypto> AvailableCryptos { get; set; } = new();
|
||||
public List<AvailablePaymentMethod> AvailablePaymentMethods { get; set; } = new();
|
||||
public bool IsModal { get; set; }
|
||||
public bool IsUnsetTopUp { get; set; }
|
||||
public bool OnChainWithLnInvoiceFallback { get; set; }
|
||||
|
@ -15,12 +15,9 @@ namespace BTCPayServer.Plugins.NFC
|
||||
|
||||
public override void Execute(IServiceCollection applicationBuilder)
|
||||
{
|
||||
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("NFC/CheckoutEnd",
|
||||
"checkout-end"));
|
||||
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("NFC/LNURLNFCPostContent",
|
||||
"checkout-lightning-post-content"));
|
||||
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("NFC/LNURLNFCPostContent",
|
||||
"checkout-bitcoin-post-content"));
|
||||
applicationBuilder.AddUIExtension("checkout-end", "NFC/CheckoutEnd");
|
||||
applicationBuilder.AddUIExtension("checkout-lightning-post-content", "NFC/LNURLNFCPostContent");
|
||||
applicationBuilder.AddUIExtension("checkout-bitcoin-post-content", "NFC/LNURLNFCPostContent");
|
||||
base.Execute(applicationBuilder);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ Vue.component("lnurl-withdraw-checkout", {
|
||||
const {
|
||||
onChainWithLnInvoiceFallback: isUnified,
|
||||
paymentMethodId: activePaymentMethodId,
|
||||
availableCryptos: availablePaymentMethods,
|
||||
availablePaymentMethods: availablePaymentMethods,
|
||||
invoiceBitcoinUrl: paymentUrl
|
||||
} = this.model
|
||||
const lnurlwAvailable =
|
||||
|
@ -12,7 +12,7 @@
|
||||
ViewData["StoreBranding"] = Model.StoreBranding;
|
||||
Csp.UnsafeEval();
|
||||
var hasPaymentPlugins = UiExtensions.Any(extension => extension.Location == "checkout-payment-method");
|
||||
var displayedPaymentMethods = Model.AvailableCryptos.Where(c => c.Displayed).ToList();
|
||||
var displayedPaymentMethods = Model.AvailablePaymentMethods.Where(c => c.Displayed).ToList();
|
||||
}
|
||||
@functions {
|
||||
private string ToJsValue(object value)
|
||||
|
@ -1,7 +1,6 @@
|
||||
@model CheckoutModel
|
||||
@{
|
||||
Layout = null;
|
||||
var displayedPaymentMethods = Model.AvailableCryptos.Where(a => a.Displayed).ToList();
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -172,7 +172,7 @@ function initApp() {
|
||||
: null;
|
||||
},
|
||||
paymentMethodIds () {
|
||||
return this.srvModel.availableCryptos.map(function (c) { return c.paymentMethodId });
|
||||
return this.srvModel.availablePaymentMethod.map(function (c) { return c.paymentMethodId });
|
||||
},
|
||||
paymentMethodComponent() {
|
||||
return this.isPluginPaymentMethod
|
||||
|
Loading…
Reference in New Issue
Block a user