diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs index 54479a76b..809420fce 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs @@ -12,10 +12,8 @@ using BTCPayServer.Client.Models; using BTCPayServer.Data; using BTCPayServer.HostedServices; using BTCPayServer.Payments; -using BTCPayServer.Payments.Bitcoin; using BTCPayServer.Payouts; using BTCPayServer.Rating; -using BTCPayServer.Security; using BTCPayServer.Security.Greenfield; using BTCPayServer.Services; using BTCPayServer.Services.Invoices; @@ -25,9 +23,6 @@ using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using NBitcoin; -using NBitpayClient; using Newtonsoft.Json.Linq; using CreateInvoiceRequest = BTCPayServer.Client.Models.CreateInvoiceRequest; using InvoiceData = BTCPayServer.Client.Models.InvoiceData; @@ -600,12 +595,13 @@ namespace BTCPayServer.Controllers.Greenfield { statuses.Add(InvoiceStatus.Settled); } - if (state.CanMarkInvalid()) { statuses.Add(InvoiceStatus.Invalid); } - return new InvoiceData() + var store = request?.HttpContext.GetStoreData(); + var receipt = store == null ? entity.ReceiptOptions : InvoiceDataBase.ReceiptOptions.Merge(store.GetStoreBlob().ReceiptOptions, entity.ReceiptOptions); + return new InvoiceData { StoreId = entity.StoreId, ExpirationTime = entity.ExpirationTime, @@ -621,7 +617,7 @@ namespace BTCPayServer.Controllers.Greenfield Archived = entity.Archived, Metadata = entity.Metadata.ToJObject(), AvailableStatusesForManualMarking = statuses.ToArray(), - Checkout = new CreateInvoiceRequest.CheckoutOptions() + Checkout = new InvoiceDataBase.CheckoutOptions { Expiration = entity.ExpirationTime - entity.InvoiceTime, Monitoring = entity.MonitoringExpiration - entity.ExpirationTime, @@ -634,7 +630,7 @@ namespace BTCPayServer.Controllers.Greenfield RedirectAutomatically = entity.RedirectAutomatically, RedirectURL = entity.RedirectURLTemplate }, - Receipt = entity.ReceiptOptions + Receipt = receipt }; } }