Fix TeleBot compilation errors - use RequiredAmount property

- Fixed CryptoAmount property that doesn't exist
- Display £ amounts with note about needing conversion
- Show actual crypto amounts when less than 1.0
This commit is contained in:
SysAdmin 2025-09-24 19:26:40 +01:00
parent ddff64991b
commit 5013e60358

View File

@ -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))