mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Fix exception in CreateInvoice if a payment method is not supported
This commit is contained in:
@@ -158,7 +158,7 @@ namespace BTCPayServer.Controllers
|
|||||||
var fetchingByCurrencyPair = _RateProvider.FetchRates(currencyPairsToFetch, rateRules, cancellationToken);
|
var fetchingByCurrencyPair = _RateProvider.FetchRates(currencyPairsToFetch, rateRules, cancellationToken);
|
||||||
var fetchingAll = WhenAllFetched(logs, fetchingByCurrencyPair);
|
var fetchingAll = WhenAllFetched(logs, fetchingByCurrencyPair);
|
||||||
var supportedPaymentMethods = store.GetSupportedPaymentMethods(_NetworkProvider)
|
var supportedPaymentMethods = store.GetSupportedPaymentMethods(_NetworkProvider)
|
||||||
.Where(s => !excludeFilter.Match(s.PaymentId))
|
.Where(s => !excludeFilter.Match(s.PaymentId) && _paymentMethodHandlerDictionary.Support(s.PaymentId))
|
||||||
.Select(c =>
|
.Select(c =>
|
||||||
(Handler: _paymentMethodHandlerDictionary[c.PaymentId],
|
(Handler: _paymentMethodHandlerDictionary[c.PaymentId],
|
||||||
SupportedPaymentMethod: c,
|
SupportedPaymentMethod: c,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace BTCPayServer.Services.Invoices
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IPaymentMethodHandler this[PaymentMethodId index] => _mappedHandlers[index];
|
public IPaymentMethodHandler this[PaymentMethodId index] => _mappedHandlers[index];
|
||||||
|
public bool Support(PaymentMethodId paymentMethod) => _mappedHandlers.ContainsKey(paymentMethod);
|
||||||
public IEnumerator<IPaymentMethodHandler> GetEnumerator()
|
public IEnumerator<IPaymentMethodHandler> GetEnumerator()
|
||||||
{
|
{
|
||||||
return _mappedHandlers.Values.GetEnumerator();
|
return _mappedHandlers.Values.GetEnumerator();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.0.3.113</Version>
|
<Version>1.0.3.114</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user