mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
switch to jobj
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using BTCPayServer.JsonConverters;
|
using BTCPayServer.JsonConverters;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace BTCPayServer.Client.Models
|
namespace BTCPayServer.Client.Models
|
||||||
{
|
{
|
||||||
@@ -34,7 +35,7 @@ namespace BTCPayServer.Client.Models
|
|||||||
public string PaymentMethod { get; set; }
|
public string PaymentMethod { get; set; }
|
||||||
|
|
||||||
public string CryptoCode { get; set; }
|
public string CryptoCode { get; set; }
|
||||||
public Dictionary<string, object> AdditionalData { get; set; }
|
public Dictionary<string, JObject> AdditionalData { get; set; }
|
||||||
|
|
||||||
public class Payment
|
public class Payment
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace BTCPayServer.Payments
|
namespace BTCPayServer.Payments
|
||||||
{
|
{
|
||||||
@@ -21,6 +22,6 @@ namespace BTCPayServer.Payments
|
|||||||
|
|
||||||
bool Activated { get; set; }
|
bool Activated { get; set; }
|
||||||
virtual string GetAdditionalDataPartialName() => null;
|
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.Lightning;
|
||||||
using BTCPayServer.Payments.Lightning;
|
using BTCPayServer.Payments.Lightning;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace BTCPayServer.Payments
|
namespace BTCPayServer.Payments
|
||||||
{
|
{
|
||||||
@@ -34,17 +35,17 @@ namespace BTCPayServer.Payments
|
|||||||
return "LNURL/AdditionalPaymentMethodDetails";
|
return "LNURL/AdditionalPaymentMethodDetails";
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Dictionary<string, object> GetAdditionalData()
|
public override Dictionary<string, JObject> GetAdditionalData()
|
||||||
{
|
{
|
||||||
var result = base.GetAdditionalData();
|
var result = base.GetAdditionalData();
|
||||||
if (!string.IsNullOrEmpty(ProvidedComment))
|
if (!string.IsNullOrEmpty(ProvidedComment))
|
||||||
{
|
{
|
||||||
result.TryAdd(nameof(ProvidedComment), ProvidedComment);
|
result.TryAdd(nameof(ProvidedComment), new JObject(ProvidedComment));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(ConsumedLightningAddress))
|
if (!string.IsNullOrEmpty(ConsumedLightningAddress))
|
||||||
{
|
{
|
||||||
result.TryAdd(nameof(ConsumedLightningAddress), ConsumedLightningAddress);
|
result.TryAdd(nameof(ConsumedLightningAddress), new JObject(ConsumedLightningAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BTCPayServer.Lightning;
|
using BTCPayServer.Lightning;
|
||||||
using NBitcoin;
|
using NBitcoin;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace BTCPayServer.Payments.Lightning
|
namespace BTCPayServer.Payments.Lightning
|
||||||
{
|
{
|
||||||
@@ -42,7 +43,7 @@ namespace BTCPayServer.Payments.Lightning
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Dictionary<string, object> GetAdditionalData()
|
public virtual Dictionary<string, JObject> GetAdditionalData()
|
||||||
{
|
{
|
||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user