Allowing customization of expiry time for easier debugging

This commit is contained in:
lepipele
2017-10-20 17:32:52 -05:00
parent 8fe5835e09
commit 0f603ffb0a
2 changed files with 3 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ namespace BTCPayServer.Controllers
_FeeProvider = feeProvider ?? throw new ArgumentNullException(nameof(feeProvider));
}
internal async Task<DataWrapper<InvoiceResponse>> CreateInvoiceCore(Invoice invoice, StoreData store, string serverUrl)
internal async Task<DataWrapper<InvoiceResponse>> CreateInvoiceCore(Invoice invoice, StoreData store, string serverUrl, double expiryMinutes = 15)
{
var derivationStrategy = store.DerivationStrategy;
var entity = new InvoiceEntity
@@ -87,7 +87,7 @@ namespace BTCPayServer.Controllers
if(notificationUri == null || (notificationUri.Scheme != "http" && notificationUri.Scheme != "https")) //TODO: Filer non routable addresses ?
notificationUri = null;
EmailAddressAttribute emailValidator = new EmailAddressAttribute();
entity.ExpirationTime = entity.InvoiceTime + TimeSpan.FromMinutes(15.0);
entity.ExpirationTime = entity.InvoiceTime.AddMinutes(expiryMinutes);
entity.ServerUrl = serverUrl;
entity.FullNotifications = invoice.FullNotifications;
entity.NotificationURL = notificationUri?.AbsoluteUri;