mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 01:43:50 +01:00
Do not crash if payment method disabled when store supports it
This commit is contained in:
parent
0f79526566
commit
a698aa8a5b
@ -121,9 +121,11 @@ namespace BTCPayServer.Payments
|
|||||||
}
|
}
|
||||||
foreach (var paymentMethodConfig in store.GetPaymentMethodConfigs())
|
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);
|
PaymentMethodContexts.Add(paymentMethodConfig.Key, ctx);
|
||||||
if (excludeFilter.Match(paymentMethodConfig.Key) || !handlers.Support(paymentMethodConfig.Key))
|
if (excludeFilter.Match(paymentMethodConfig.Key))
|
||||||
ctx.Status = PaymentMethodContext.ContextStatus.Excluded;
|
ctx.Status = PaymentMethodContext.ContextStatus.Excluded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user