mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 15:14:49 +01:00
Do not crash if payment method disabled when store supports it
This commit is contained in:
@@ -121,9 +121,11 @@ namespace BTCPayServer.Payments
|
||||
}
|
||||
foreach (var paymentMethodConfig in store.GetPaymentMethodConfigs())
|
||||
{
|
||||
var ctx = new PaymentMethodContext(store, storeBlob, paymentMethodConfig.Value, handlers[paymentMethodConfig.Key], invoiceEntity, invoiceLogs);
|
||||
if (!handlers.TryGetValue(paymentMethodConfig.Key, out var handler))
|
||||
continue;
|
||||
var ctx = new PaymentMethodContext(store, storeBlob, paymentMethodConfig.Value, handler, invoiceEntity, invoiceLogs);
|
||||
PaymentMethodContexts.Add(paymentMethodConfig.Key, ctx);
|
||||
if (excludeFilter.Match(paymentMethodConfig.Key) || !handlers.Support(paymentMethodConfig.Key))
|
||||
if (excludeFilter.Match(paymentMethodConfig.Key))
|
||||
ctx.Status = PaymentMethodContext.ContextStatus.Excluded;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user