Recommended exchange to be resolved during Invoice Creation (#5976)

* Recommended Exchange Rate Selection during Invoice Creation

* Make Recommended exchanges pluginifiable
This commit is contained in:
Nicolas Dorier
2024-05-13 22:29:42 +09:00
committed by GitHub
parent b0da802abe
commit d96b066658
26 changed files with 255 additions and 166 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(_defaultRates);
rules = store.GetStoreBlob().GetRateRules(_defaultRules);
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(_defaultRates);
rules = store.GetStoreBlob().GetRateRules(_defaultRules);
rateResult = await _RateProvider.FetchRate(
new CurrencyPair(paymentMethodCurrency, model.CustomCurrency), rules, new StoreIdRateContext(store.Id),
cancellationToken);