diff --git a/BTCPayServer/Controllers/InvoiceController.cs b/BTCPayServer/Controllers/InvoiceController.cs index 6f06573c0..fb71a2124 100644 --- a/BTCPayServer/Controllers/InvoiceController.cs +++ b/BTCPayServer/Controllers/InvoiceController.cs @@ -61,7 +61,7 @@ namespace BTCPayServer.Controllers } - internal async Task> CreateInvoiceCore(Invoice invoice, StoreData store, string serverUrl) + internal async Task> CreateInvoiceCore(Invoice invoice, StoreData store, string serverUrl, List additionalTags = null) { if (!store.HasClaim(Policies.CanCreateInvoice.Key)) throw new UnauthorizedAccessException(); @@ -86,6 +86,10 @@ namespace BTCPayServer.Controllers entity.NotificationEmail = invoice.NotificationEmail; entity.BuyerInformation = Map(invoice); entity.PaymentTolerance = storeBlob.PaymentTolerance; + if (additionalTags != null) + entity.InternalTags.AddRange(additionalTags); + if (storeBlob.InternalTags != null) + entity.InternalTags.AddRange(storeBlob.InternalTags); //Another way of passing buyer info to support FillBuyerInfo(invoice.Buyer, entity.BuyerInformation); if (entity?.BuyerInformation?.BuyerEmail != null) diff --git a/BTCPayServer/Data/StoreData.cs b/BTCPayServer/Data/StoreData.cs index 0232eafa0..a5d44e957 100644 --- a/BTCPayServer/Data/StoreData.cs +++ b/BTCPayServer/Data/StoreData.cs @@ -424,6 +424,9 @@ namespace BTCPayServer.Data public EmailSettings EmailSettings { get; set; } + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] + public HashSet InternalTags { get; set; } = new HashSet(); + public IPaymentFilter GetExcludedPaymentMethods() { #pragma warning disable CS0618 // Type or member is obsolete diff --git a/BTCPayServer/Services/Invoices/InvoiceEntity.cs b/BTCPayServer/Services/Invoices/InvoiceEntity.cs index cb54640f1..ef06d8cd9 100644 --- a/BTCPayServer/Services/Invoices/InvoiceEntity.cs +++ b/BTCPayServer/Services/Invoices/InvoiceEntity.cs @@ -164,6 +164,9 @@ namespace BTCPayServer.Services.Invoices set; } + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] + public HashSet InternalTags { get; set; } = new HashSet(); + [Obsolete("Use GetDerivationStrategies instead")] public string DerivationStrategy {