Adding links to invoice for review

This commit is contained in:
rockstardev
2025-05-12 23:58:31 -05:00
parent 2b86d4c9dc
commit 24d84e6f8f
2 changed files with 17 additions and 2 deletions

View File

@@ -116,5 +116,17 @@ namespace BTCPayServer.Services
pathBase: request.PathBase
) ?? throw Bug();
}
public string InvoiceLink(string invoiceId, HttpRequest request)
{
return LinkGenerator.GetUriByAction(
action: nameof(UIInvoiceController.Invoice),
controller: "UIInvoice",
values: new { invoiceId },
scheme: request.Scheme,
host: request.Host,
pathBase: request.PathBase
) ?? throw Bug();
}
}
}

View File

@@ -163,13 +163,16 @@
subject: 'Invoice {Invoice.Id} payment settled',
body: 'Invoice {Invoice.Id} (Order Id: {Invoice.OrderId}) payment settled.'
},
@{ var invoiceLink = CallbackGenerator.InvoiceLink("INVOICE_ID", this.Context.Request).Replace("INVOICE_ID", ""); }
@WebhookEventType.InvoiceExpiredPaidPartial: {
subject: 'Invoice {Invoice.Id} Expired Paid Partial',
body: 'Invoice {Invoice.Id} (Order Id: {Invoice.OrderId}) has expired partially paid.'
body: 'Invoice {Invoice.Id} (Order Id: {Invoice.OrderId}) has expired partially paid. '+
'\nPlease review and take appropriate action: ' + @Safe.Json(invoiceLink) + '{Invoice.Id}'
},
@WebhookEventType.InvoicePaidAfterExpiration: {
subject: 'Invoice {Invoice.Id} Expired Paid Late',
body: 'Invoice {Invoice.Id} (Order Id: {Invoice.OrderId}) has been paid after expiration.'
body: 'Invoice {Invoice.Id} (Order Id: {Invoice.OrderId}) has been paid after expiration. '+
'\nPlease review and take appropriate action: ' + @Safe.Json(invoiceLink) + '{Invoice.Id}'
},
@{ var paymentRequestsLink = CallbackGenerator.PaymentRequestListLink(storeId, this.Context.Request); }
@WebhookEventType.PaymentRequestCompleted: {