Move checkout registration to the UI Extension

This commit is contained in:
nicolas.dorier
2024-10-07 17:38:02 +09:00
parent ef0ba7b0c4
commit e1bfc04451
21 changed files with 31 additions and 100 deletions

View File

@@ -941,19 +941,9 @@ namespace BTCPayServer.Controllers
extension.ModifyPaymentModel(new PaymentModelContext(model, store, storeBlob, invoice, Url, kv, h, paymentMethodId == kv.PaymentMethodId));
}
}
model.UISettings = _viewProvider.TryGetViewViewModel(prompt, "CheckoutUI")?.View as CheckoutUIPaymentMethodSettings;
model.PaymentMethodId = paymentMethodId.ToString();
model.OrderAmountFiat = OrderAmountFromInvoice(model.CryptoCode, invoice, DisplayFormatter.CurrencyFormat.Symbol);
foreach (var paymentPrompt in invoice.GetPaymentPrompts())
{
var vvm = _viewProvider.TryGetViewViewModel(paymentPrompt, "CheckoutUI");
if (vvm?.View is CheckoutUIPaymentMethodSettings { ExtensionPartial: { } partial })
{
model.ExtensionPartials.Add(partial);
}
}
if (storeBlob.PlaySoundOnPayment)
{
model.PaymentSoundUrl = storeBlob.PaymentSoundUrl is null