Decouple DefaultRates from BTCPayNetwork (#5974)

This commit is contained in:
Nicolas Dorier
2024-05-09 17:20:24 +09:00
committed by GitHub
parent 4c303d358b
commit adbe5977cd
17 changed files with 85 additions and 48 deletions

View File

@@ -382,7 +382,7 @@ namespace BTCPayServer.Controllers
var paidCurrency = Math.Round(cryptoPaid * paymentMethod.Rate, cdCurrency.Divisibility);
model.CryptoAmountThen = cryptoPaid.RoundToSignificant(paymentMethod.Divisibility);
model.RateThenText = _displayFormatter.Currency(model.CryptoAmountThen, paymentMethodCurrency);
rules = store.GetStoreBlob().GetRateRules(_NetworkProvider);
rules = store.GetStoreBlob().GetRateRules(_defaultRates);
rateResult = await _RateProvider.FetchRate(
new CurrencyPair(paymentMethodCurrency, invoice.Currency), rules, new StoreIdRateContext(store.Id),
cancellationToken);
@@ -491,7 +491,7 @@ namespace BTCPayServer.Controllers
return View("_RefundModal", model);
}
rules = store.GetStoreBlob().GetRateRules(_NetworkProvider);
rules = store.GetStoreBlob().GetRateRules(_defaultRates);
rateResult = await _RateProvider.FetchRate(
new CurrencyPair(paymentMethodCurrency, model.CustomCurrency), rules, new StoreIdRateContext(store.Id),
cancellationToken);