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:
parent
409531fd79
commit
ddff64991b
@ -615,12 +615,22 @@ namespace TeleBot.Handlers
|
|||||||
|
|
||||||
session.State = SessionState.CheckoutFlow;
|
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(
|
await bot.SendTextMessageAsync(
|
||||||
message.Chat.Id,
|
message.Chat.Id,
|
||||||
"📦 *Checkout - Step 1/5*\n\n" +
|
"📦 *Checkout - Delivery Details*\n\n" +
|
||||||
"Please enter your shipping name:\n\n" +
|
"Please provide all delivery details in one message:\n\n" +
|
||||||
"_Reply to this message with your name_",
|
"• 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
|
parseMode: Telegram.Bot.Types.Enums.ParseMode.Markdown
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -290,7 +290,8 @@ namespace TeleBot.UI
|
|||||||
{
|
{
|
||||||
sb.AppendLine($" Address: `{payment.WalletAddress}`");
|
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)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,14 +301,20 @@ namespace TeleBot.UI
|
|||||||
public static string FormatPayment(CryptoPayment payment)
|
public static string FormatPayment(CryptoPayment payment)
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|
||||||
sb.AppendLine($"💰 *Payment Instructions*\n");
|
sb.AppendLine($"💰 *Payment Instructions*\n");
|
||||||
sb.AppendLine($"*Currency:* {FormatCurrency(payment.Currency)}");
|
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($"*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 {payment.RequiredAmount} {FormatCurrency(payment.Currency)} to:*");
|
sb.AppendLine($"\n*Send exactly {cryptoAmount} {FormatCurrency(payment.Currency)} to:*");
|
||||||
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