Add support for Bitpay invoice create property "paymentCurrencies" (#1589)

This commit is contained in:
Andrew Camilleri
2020-05-24 12:11:26 +02:00
committed by GitHub
parent b5102c4269
commit 80563de587
2 changed files with 13 additions and 1 deletions

View File

@@ -129,7 +129,15 @@ namespace BTCPayServer.Controllers
HashSet<CurrencyPair> currencyPairsToFetch = new HashSet<CurrencyPair>();
var rules = storeBlob.GetRateRules(_NetworkProvider);
var excludeFilter = storeBlob.GetExcludedPaymentMethods(); // Here we can compose filters from other origin with PaymentFilter.Any()
if (invoice.PaymentCurrencies?.Any() is true)
{
foreach (string paymentCurrency in invoice.PaymentCurrencies)
{
invoice.SupportedTransactionCurrencies.TryAdd(paymentCurrency,
new InvoiceSupportedTransactionCurrency() {Enabled = true});
}
}
if (invoice.SupportedTransactionCurrencies != null && invoice.SupportedTransactionCurrencies.Count != 0)
{
var supportedTransactionCurrencies = invoice.SupportedTransactionCurrencies