diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index a49fe8442..aae2b935d 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -906,8 +906,11 @@ namespace BTCPayServer.Controllers } catch (BitpayHttpException ex) { - Logs.PayServer.LogError(ex, $"Invoice creation failed due to invalid currency {model.Currency}"); - ModelState.TryAddModelError(nameof(model.Currency), "Please make sure you entered a valid currency symbol, a rate provider is configured in store settings, and your configured rate provider is both online and providing rates for your selected currency."); + this.TempData.SetStatusMessageModel(new StatusMessageModel() + { + Severity = StatusMessageModel.StatusSeverity.Error, + Message = ex.Message + }); return View(model); } } diff --git a/BTCPayServer/Controllers/InvoiceController.cs b/BTCPayServer/Controllers/InvoiceController.cs index 37a6dbf20..415cc4ff0 100644 --- a/BTCPayServer/Controllers/InvoiceController.cs +++ b/BTCPayServer/Controllers/InvoiceController.cs @@ -409,6 +409,11 @@ namespace BTCPayServer.Controllers return null; } } + else + { + var suffix = currentRateToCrypto?.EvaluatedRule is string s ? $" ({s})" : string.Empty; + logs.Write($"{logPrefix} This payment method should be created only if the amount of this invoice is in proper range. However, we are unable to fetch the rate of those limits. {suffix}", InvoiceEventData.EventSeverity.Warning); + } } #pragma warning disable CS0618 diff --git a/BTCPayServer/Views/Shared/_StatusMessage.cshtml b/BTCPayServer/Views/Shared/_StatusMessage.cshtml index 5c5fef515..71190a8d6 100644 --- a/BTCPayServer/Views/Shared/_StatusMessage.cshtml +++ b/BTCPayServer/Views/Shared/_StatusMessage.cshtml @@ -1,4 +1,4 @@ -@{ +@{ var parsedModel = TempData.GetStatusMessageModel(); } @@ -13,7 +13,7 @@ } @if (!string.IsNullOrEmpty(parsedModel.Message)) { - @parsedModel.Message + @parsedModel.Message } @if (!string.IsNullOrEmpty(parsedModel.Html)) {