Allow Placeholders in redirectURL (Fix #169)

This commit is contained in:
nicolas.dorier
2019-09-02 16:04:41 +09:00
parent 57b436417c
commit 6bd601137a
2 changed files with 21 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ namespace BTCPayServer.Controllers
Uri.TryCreate(invoice.NotificationURL, UriKind.Absolute, out var notificationUri) &&
(notificationUri.Scheme == "http" || notificationUri.Scheme == "https"))
{
entity.NotificationURL = notificationUri.AbsoluteUri;
entity.NotificationURLTemplate = notificationUri.AbsoluteUri;
}
entity.NotificationEmail = invoice.NotificationEmail;
entity.BuyerInformation = Map<CreateInvoiceRequest, BuyerInformation>(invoice);
@@ -119,9 +119,9 @@ namespace BTCPayServer.Controllers
entity.ProductInformation = Map<CreateInvoiceRequest, ProductInformation>(invoice);
entity.RedirectURL = invoice.RedirectURL ?? store.StoreWebsite;
entity.RedirectURLTemplate = invoice.RedirectURL ?? store.StoreWebsite;
if (!Uri.IsWellFormedUriString(entity.RedirectURL, UriKind.Absolute))
entity.RedirectURL = null;
entity.RedirectURLTemplate = null;
entity.RedirectAutomatically =
invoice.RedirectAutomatically.GetValueOrDefault(storeBlob.RedirectAutomatically);