diff --git a/TeleBot/TeleBot/UI/MessageFormatter.cs b/TeleBot/TeleBot/UI/MessageFormatter.cs index 2eb9189..43bc38e 100644 --- a/TeleBot/TeleBot/UI/MessageFormatter.cs +++ b/TeleBot/TeleBot/UI/MessageFormatter.cs @@ -290,8 +290,12 @@ namespace TeleBot.UI { sb.AppendLine($" Address: `{payment.WalletAddress}`"); } - var cryptoAmount = payment.CryptoAmount > 0 ? payment.CryptoAmount.ToString("F8") : payment.RequiredAmount.ToString("F2"); - sb.AppendLine($" Amount: {cryptoAmount} {FormatCurrency(payment.Currency)}"); + // Check if amount looks like a crypto amount (less than 1 for typical orders) + var isCryptoAmount = payment.RequiredAmount < 1.0m; + var amountDisplay = isCryptoAmount + ? $"{payment.RequiredAmount:F8} {FormatCurrency(payment.Currency)}" + : $"£{payment.RequiredAmount:F2} (needs conversion to {FormatCurrency(payment.Currency)})"; + sb.AppendLine($" Amount: {amountDisplay}"); } } @@ -304,17 +308,30 @@ namespace TeleBot.UI sb.AppendLine($"💰 *Payment Instructions*\n"); sb.AppendLine($"*Currency:* {FormatCurrency(payment.Currency)}"); - // Show crypto amount if available, otherwise show the order amount with note - var cryptoAmount = payment.CryptoAmount > 0 ? payment.CryptoAmount.ToString("F8") : payment.RequiredAmount.ToString("F2"); - sb.AppendLine($"*Amount:* `{cryptoAmount} {FormatCurrency(payment.Currency)}`"); - if (payment.CryptoAmount <= 0) + // Check if amount looks like a crypto amount (less than 1 for typical orders) + var isCryptoAmount = payment.RequiredAmount < 1.0m; + if (isCryptoAmount) { - sb.AppendLine($"*Order Total:* £{payment.RequiredAmount:F2} (awaiting rate conversion)"); + sb.AppendLine($"*Amount:* `{payment.RequiredAmount:F8} {FormatCurrency(payment.Currency)}`"); + } + else + { + // This looks like a GBP amount that needs conversion + sb.AppendLine($"*Order Total:* £{payment.RequiredAmount:F2}"); + sb.AppendLine($"*Note:* Amount needs conversion to {FormatCurrency(payment.Currency)}"); + sb.AppendLine($"*Please check payment link for actual crypto amount*"); } sb.AppendLine($"*Status:* {FormatPaymentStatus(payment.Status)}"); sb.AppendLine($"*Expires:* {payment.ExpiresAt:yyyy-MM-dd HH:mm} UTC"); - sb.AppendLine($"\n*Send exactly {cryptoAmount} {FormatCurrency(payment.Currency)} to:*"); + if (isCryptoAmount) + { + sb.AppendLine($"\n*Send exactly {payment.RequiredAmount:F8} {FormatCurrency(payment.Currency)} to:*"); + } + else + { + sb.AppendLine($"\n*Wallet Address:*"); + } sb.AppendLine($"`{payment.WalletAddress}`"); if (!string.IsNullOrEmpty(payment.BTCPayCheckoutUrl))