Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions BTCPayServer.Plugins.Branta/Services/BrantaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -75,11 +76,13 @@ private async Task AddZeroKnowledgeParametersIfNeededAsync(
return;
}

var payload = new JObject
{
[Constants.PaymentId] = brantaInvoice.PaymentId,
[Constants.ZeroKnowledgeSecret] = brantaInvoice.ZeroKnowledgeSecret
};
var existingInvoice = await invoiceRepository.GetInvoice(btcPayInvoiceId);
var additionalData = existingInvoice?.Metadata?.AdditionalData
?? new Dictionary<string, JToken>();

var payload = JObject.FromObject(additionalData);
payload[Constants.PaymentId] = brantaInvoice.PaymentId;
payload[Constants.ZeroKnowledgeSecret] = brantaInvoice.ZeroKnowledgeSecret;

checkoutModel.SetZeroKnowledgeParams(brantaInvoice.PaymentId, brantaInvoice.ZeroKnowledgeSecret);

Expand Down