Allow overriding UI of checkout in payment handler (#992)

This commit is contained in:
Andrew Camilleri
2019-08-25 15:50:11 +02:00
committed by Nicolas Dorier
parent 989a7b863e
commit 43ee22f965
7 changed files with 296 additions and 246 deletions

View File

@@ -167,7 +167,6 @@ namespace BTCPayServer.Controllers
return View(model);
}
//TODO: abstract
private async Task<PaymentModel> GetInvoiceModel(string invoiceId, PaymentMethodId paymentMethodId)
{
var invoice = await _InvoiceRepository.GetInvoice(invoiceId);
@@ -297,6 +296,7 @@ namespace BTCPayServer.Controllers
};
paymentMethodHandler.PreparePaymentModel(model, dto);
model.UISettings = paymentMethodHandler.GetCheckoutUISettings();
model.PaymentMethodId = paymentMethodId.ToString();
var expiration = TimeSpan.FromSeconds(model.ExpirationSeconds);
model.TimeLeft = expiration.PrettyPrint();