Include amount paid on greenfield invoice (#6747)

* Include amount paid on greenfield invoice

* revert changes in invoice watcher

* Round up currency and include changes in swagger docs

* Add test

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
This commit is contained in:
Chukwuleta Tobechi
2025-05-24 13:44:35 +01:00
committed by GitHub
parent 4bea616125
commit c483705761
6 changed files with 69 additions and 55 deletions

View File

@@ -9,6 +9,7 @@ using BTCPayServer.Data;
using BTCPayServer.Models;
using BTCPayServer.Plugins.PayButton.Models;
using BTCPayServer.Services.Invoices;
using BTCPayServer.Services.Rates;
using BTCPayServer.Services.Stores;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
@@ -23,14 +24,17 @@ namespace BTCPayServer.Controllers
public UIPublicController(UIInvoiceController invoiceController,
StoreRepository storeRepository,
IStringLocalizer stringLocalizer,
CurrencyNameTable currencyNameTable,
LinkGenerator linkGenerator)
{
_InvoiceController = invoiceController;
_currencyNameTable = currencyNameTable;
_StoreRepository = storeRepository;
_linkGenerator = linkGenerator;
StringLocalizer = stringLocalizer;
}
private readonly CurrencyNameTable _currencyNameTable;
private readonly UIInvoiceController _InvoiceController;
private readonly StoreRepository _StoreRepository;
private readonly LinkGenerator _linkGenerator;
@@ -105,7 +109,7 @@ namespace BTCPayServer.Controllers
return View();
}
var url = GreenfieldInvoiceController.ToModel(invoice, _linkGenerator, HttpContext.Request).CheckoutLink;
var url = GreenfieldInvoiceController.ToModel(invoice, _linkGenerator, _currencyNameTable, HttpContext.Request).CheckoutLink;
if (!string.IsNullOrEmpty(model.CheckoutQueryString))
{
var additionalParamValues = HttpUtility.ParseQueryString(model.CheckoutQueryString);