fixed tg message
This commit is contained in:
@@ -2,6 +2,7 @@ package notificationimp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -366,22 +367,24 @@ func parseConfirmationReply(text string) (*paymenttypes.Money, string, error) {
|
||||
func confirmationPrompt(req *model.ConfirmationRequest) string {
|
||||
var builder strings.Builder
|
||||
builder.WriteString("Payment confirmation required\n")
|
||||
if req.PaymentIntentID != "" {
|
||||
builder.WriteString("Payment intent: ")
|
||||
builder.WriteString(req.PaymentIntentID)
|
||||
builder.WriteString("\n")
|
||||
}
|
||||
if req.QuoteRef != "" {
|
||||
builder.WriteString("Quote ref: ")
|
||||
builder.WriteString(req.QuoteRef)
|
||||
builder.WriteString("\n")
|
||||
}
|
||||
if req.RequestedMoney != nil {
|
||||
builder.WriteString("Requested: ")
|
||||
builder.WriteString(req.RequestedMoney.Amount)
|
||||
builder.WriteString(" ")
|
||||
builder.WriteString(req.RequestedMoney.Currency)
|
||||
builder.WriteString("\n")
|
||||
amountFloat, err := strconv.ParseFloat(req.RequestedMoney.Amount, 64)
|
||||
if err != nil {
|
||||
amountFloat = 0
|
||||
}
|
||||
|
||||
amount := fmt.Sprintf("%.2f", amountFloat)
|
||||
|
||||
builder.WriteString(fmt.Sprintf(
|
||||
"\n*Requested: %s %s*\n\n",
|
||||
amount,
|
||||
req.RequestedMoney.Currency,
|
||||
))
|
||||
}
|
||||
builder.WriteString("Reply with \"<amount> <currency>\" (e.g., 12.34 USD).")
|
||||
return builder.String()
|
||||
|
||||
Reference in New Issue
Block a user