diff --git a/BTCPayServer.Client/Models/InvoicePaymentMethodDataModel.cs b/BTCPayServer.Client/Models/InvoicePaymentMethodDataModel.cs index 3d2137943..3166ef968 100644 --- a/BTCPayServer.Client/Models/InvoicePaymentMethodDataModel.cs +++ b/BTCPayServer.Client/Models/InvoicePaymentMethodDataModel.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using BTCPayServer.JsonConverters; using Newtonsoft.Json; using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; namespace BTCPayServer.Client.Models { @@ -34,7 +35,7 @@ namespace BTCPayServer.Client.Models public string PaymentMethod { get; set; } public string CryptoCode { get; set; } - public Dictionary AdditionalData { get; set; } + public Dictionary AdditionalData { get; set; } public class Payment { diff --git a/BTCPayServer/Payments/IPaymentMethodDetails.cs b/BTCPayServer/Payments/IPaymentMethodDetails.cs index 62c2d6010..3c27297ad 100644 --- a/BTCPayServer/Payments/IPaymentMethodDetails.cs +++ b/BTCPayServer/Payments/IPaymentMethodDetails.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Newtonsoft.Json.Linq; namespace BTCPayServer.Payments { @@ -21,6 +22,6 @@ namespace BTCPayServer.Payments bool Activated { get; set; } virtual string GetAdditionalDataPartialName() => null; - virtual Dictionary GetAdditionalData() => new(); + virtual Dictionary GetAdditionalData() => new(); } } diff --git a/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentMethodDetails.cs b/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentMethodDetails.cs index b5f16576e..63f31959a 100644 --- a/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentMethodDetails.cs +++ b/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentMethodDetails.cs @@ -3,6 +3,7 @@ using BTCPayServer.Client.JsonConverters; using BTCPayServer.Lightning; using BTCPayServer.Payments.Lightning; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace BTCPayServer.Payments { @@ -34,17 +35,17 @@ namespace BTCPayServer.Payments return "LNURL/AdditionalPaymentMethodDetails"; } - public override Dictionary GetAdditionalData() + public override Dictionary GetAdditionalData() { var result = base.GetAdditionalData(); if (!string.IsNullOrEmpty(ProvidedComment)) { - result.TryAdd(nameof(ProvidedComment), ProvidedComment); + result.TryAdd(nameof(ProvidedComment), new JObject(ProvidedComment)); } if (!string.IsNullOrEmpty(ConsumedLightningAddress)) { - result.TryAdd(nameof(ConsumedLightningAddress), ConsumedLightningAddress); + result.TryAdd(nameof(ConsumedLightningAddress), new JObject(ConsumedLightningAddress)); } return result; diff --git a/BTCPayServer/Payments/Lightning/LightningLikePaymentMethodDetails.cs b/BTCPayServer/Payments/Lightning/LightningLikePaymentMethodDetails.cs index c7382481b..f580c4737 100644 --- a/BTCPayServer/Payments/Lightning/LightningLikePaymentMethodDetails.cs +++ b/BTCPayServer/Payments/Lightning/LightningLikePaymentMethodDetails.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using BTCPayServer.Lightning; using NBitcoin; +using Newtonsoft.Json.Linq; namespace BTCPayServer.Payments.Lightning { @@ -42,7 +43,7 @@ namespace BTCPayServer.Payments.Lightning return null; } - public virtual Dictionary GetAdditionalData() + public virtual Dictionary GetAdditionalData() { return new(); }