Fix TeleBot checkout flow and currency display

- Remove unnecessary shipping name step (Step 1/5) - now collects all address details in one message
- Fix currency display to show crypto amounts instead of GBP values
- Display proper BTC amounts instead of showing £39.99 as 39.99 BTC
- Tor connectivity already working (verified via telebot-tor container)
This commit is contained in:
SysAdmin 2025-09-24 19:24:19 +01:00
parent 409531fd79
commit ddff64991b
2 changed files with 26 additions and 9 deletions

View File

@ -615,12 +615,22 @@ namespace TeleBot.Handlers
session.State = SessionState.CheckoutFlow;
// Send new message for checkout instead of editing
// Send new message for checkout - collect all details at once
await bot.SendTextMessageAsync(
message.Chat.Id,
"📦 *Checkout - Step 1/5*\n\n" +
"Please enter your shipping name:\n\n" +
"_Reply to this message with your name_",
"📦 *Checkout - Delivery Details*\n\n" +
"Please provide all delivery details in one message:\n\n" +
"• Full Name\n" +
"• Street Address\n" +
"• City\n" +
"• Post/Zip Code\n" +
"• Country (or leave blank for UK)\n\n" +
"_Example:_\n" +
"`John Smith\n" +
"123 Main Street\n" +
"London\n" +
"SW1A 1AA\n" +
"United Kingdom`",
parseMode: Telegram.Bot.Types.Enums.ParseMode.Markdown
);
}

View File

@ -290,7 +290,8 @@ namespace TeleBot.UI
{
sb.AppendLine($" Address: `{payment.WalletAddress}`");
}
sb.AppendLine($" Amount: {payment.RequiredAmount}");
var cryptoAmount = payment.CryptoAmount > 0 ? payment.CryptoAmount.ToString("F8") : payment.RequiredAmount.ToString("F2");
sb.AppendLine($" Amount: {cryptoAmount} {FormatCurrency(payment.Currency)}");
}
}
@ -303,11 +304,17 @@ namespace TeleBot.UI
sb.AppendLine($"💰 *Payment Instructions*\n");
sb.AppendLine($"*Currency:* {FormatCurrency(payment.Currency)}");
sb.AppendLine($"*Amount:* `{payment.RequiredAmount}`");
// 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)
{
sb.AppendLine($"*Order Total:* £{payment.RequiredAmount:F2} (awaiting rate conversion)");
}
sb.AppendLine($"*Status:* {FormatPaymentStatus(payment.Status)}");
sb.AppendLine($"*Expires:* {payment.ExpiresAt:yyyy-MM-dd HH:mm} UTC");
sb.AppendLine($"\n*Send exactly {payment.RequiredAmount} {FormatCurrency(payment.Currency)} to:*");
sb.AppendLine($"\n*Send exactly {cryptoAmount} {FormatCurrency(payment.Currency)} to:*");
sb.AppendLine($"`{payment.WalletAddress}`");
if (!string.IsNullOrEmpty(payment.BTCPayCheckoutUrl))