Make sure currency is in uppercase

This commit is contained in:
nicolas.dorier
2019-06-10 00:46:29 +09:00
parent deeab7c238
commit 15c3893aab
2 changed files with 2 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ namespace BTCPayServer.Controllers
{ {
if (!store.HasClaim(Policies.CanCreateInvoice.Key)) if (!store.HasClaim(Policies.CanCreateInvoice.Key))
throw new UnauthorizedAccessException(); throw new UnauthorizedAccessException();
invoice.Currency = invoice.Currency?.ToUpperInvariant() ?? "USD";
InvoiceLogs logs = new InvoiceLogs(); InvoiceLogs logs = new InvoiceLogs();
logs.Write("Creation of invoice starting"); logs.Write("Creation of invoice starting");
var entity = _InvoiceRepository.CreateNewInvoice(); var entity = _InvoiceRepository.CreateNewInvoice();

View File

@@ -99,7 +99,7 @@ namespace BTCPayServer.Services.Rates
AddCurrency(_CurrencyProviders, network.CryptoCode, 8, network.CryptoCode); AddCurrency(_CurrencyProviders, network.CryptoCode, 8, network.CryptoCode);
} }
} }
return _CurrencyProviders.TryGet(currency); return _CurrencyProviders.TryGet(currency.ToUpperInvariant());
} }
} }