mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
switch to jobj
This commit is contained in:
parent
1c5cf29540
commit
03bc91fd1e
@ -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<string, object> AdditionalData { get; set; }
|
||||
public Dictionary<string, JObject> AdditionalData { get; set; }
|
||||
|
||||
public class Payment
|
||||
{
|
||||
|
@ -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<string,object> GetAdditionalData() => new();
|
||||
virtual Dictionary<string,JObject> GetAdditionalData() => new();
|
||||
}
|
||||
}
|
||||
|
@ -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<string, object> GetAdditionalData()
|
||||
public override Dictionary<string, JObject> 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;
|
||||
|
@ -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<string, object> GetAdditionalData()
|
||||
public virtual Dictionary<string, JObject> GetAdditionalData()
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user