mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-21 16:04:22 +01:00
GreenField: Payment Requests CRUD (#1430)
* GreenField: Payment Requests CRUD * fixes * fix swagger * fix swag * rebase fixes * Add new permissions for payment requests * Adapt PR to archive * fix tst * add to contains policxy * make decimals returned as string due to avoid shitty language parsing issues * do not register decimal json converter as global * fix cultureinfo for json covnerter * pr changes * add json convertet test * fix json test * fix rebase
This commit is contained in:
@@ -1,22 +1,20 @@
|
||||
using NBitcoin;
|
||||
using BTCPayServer.Client.Models;
|
||||
using NBXplorer;
|
||||
using NBXplorer.DerivationStrategy;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using static BTCPayServer.Data.PaymentRequestData;
|
||||
|
||||
namespace BTCPayServer.Data
|
||||
{
|
||||
public static class PaymentRequestDataExtensions
|
||||
{
|
||||
public static PaymentRequestBlob GetBlob(this PaymentRequestData paymentRequestData)
|
||||
public static PaymentRequestBaseData GetBlob(this PaymentRequestData paymentRequestData)
|
||||
{
|
||||
var result = paymentRequestData.Blob == null
|
||||
? new PaymentRequestBlob()
|
||||
: JObject.Parse(ZipUtils.Unzip(paymentRequestData.Blob)).ToObject<PaymentRequestBlob>();
|
||||
? new PaymentRequestBaseData()
|
||||
: JObject.Parse(ZipUtils.Unzip(paymentRequestData.Blob)).ToObject<PaymentRequestBaseData>();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool SetBlob(this PaymentRequestData paymentRequestData, PaymentRequestBlob blob)
|
||||
public static bool SetBlob(this PaymentRequestData paymentRequestData, PaymentRequestBaseData blob)
|
||||
{
|
||||
var original = new Serializer(null).ToString(paymentRequestData.GetBlob());
|
||||
var newBlob = new Serializer(null).ToString(blob);
|
||||
|
||||
Reference in New Issue
Block a user