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:
parent
ddff64991b
commit
5013e60358
@ -290,8 +290,12 @@ namespace TeleBot.UI
|
|||||||
{
|
{
|
||||||
sb.AppendLine($" Address: `{payment.WalletAddress}`");
|
sb.AppendLine($" Address: `{payment.WalletAddress}`");
|
||||||
}
|
}
|
||||||
var cryptoAmount = payment.CryptoAmount > 0 ? payment.CryptoAmount.ToString("F8") : payment.RequiredAmount.ToString("F2");
|
// Check if amount looks like a crypto amount (less than 1 for typical orders)
|
||||||
sb.AppendLine($" Amount: {cryptoAmount} {FormatCurrency(payment.Currency)}");
|
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($"💰 *Payment Instructions*\n");
|
||||||
sb.AppendLine($"*Currency:* {FormatCurrency(payment.Currency)}");
|
sb.AppendLine($"*Currency:* {FormatCurrency(payment.Currency)}");
|
||||||
// Show crypto amount if available, otherwise show the order amount with note
|
// Check if amount looks like a crypto amount (less than 1 for typical orders)
|
||||||
var cryptoAmount = payment.CryptoAmount > 0 ? payment.CryptoAmount.ToString("F8") : payment.RequiredAmount.ToString("F2");
|
var isCryptoAmount = payment.RequiredAmount < 1.0m;
|
||||||
sb.AppendLine($"*Amount:* `{cryptoAmount} {FormatCurrency(payment.Currency)}`");
|
if (isCryptoAmount)
|
||||||
if (payment.CryptoAmount <= 0)
|
|
||||||
{
|
{
|
||||||
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($"*Status:* {FormatPaymentStatus(payment.Status)}");
|
||||||
sb.AppendLine($"*Expires:* {payment.ExpiresAt:yyyy-MM-dd HH:mm} UTC");
|
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}`");
|
sb.AppendLine($"`{payment.WalletAddress}`");
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(payment.BTCPayCheckoutUrl))
|
if (!string.IsNullOrEmpty(payment.BTCPayCheckoutUrl))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user