1
0
mirror of synced 2024-11-23 04:36:01 +03:00
This commit is contained in:
Alex Lushpai 2018-09-14 00:04:42 +03:00
parent 8a2e01b4bb
commit b4c72d760e
2 changed files with 10 additions and 10 deletions

View File

@ -15,12 +15,12 @@ type Options struct {
}
var (
config *TransportConfig
orm *Orm
logger *logging.Logger
options Options
parser = flags.NewParser(&options, flags.Default)
rx = regexp.MustCompile(`/+$`)
config *TransportConfig
orm *Orm
logger *logging.Logger
options Options
parser = flags.NewParser(&options, flags.Default)
rx = regexp.MustCompile(`/+$`)
currency = map[string]string{
"rub": "₽",
"uah": "₴",

View File

@ -510,14 +510,14 @@ func mgWebhookHandler(c *gin.Context) {
)
}
if msg.Data.Product.Img != "" {
if msg.Data.Product.Img != "" {
mb = fmt.Sprintf("\n%s", msg.Data.Product.Img)
}
} else if msg.Data.Type == v1.MsgTypeOrder {
mb = "**Заказ"
if msg.Data.Order.Number != ""{
if msg.Data.Order.Number != "" {
mb += " " + msg.Data.Order.Number
}
@ -527,8 +527,8 @@ func mgWebhookHandler(c *gin.Context) {
mb += "**\n"
if len(msg.Data.Order.Items) > 0 {
for _, v := range msg.Data.Order.Items {
mb += fmt.Sprintf("%s %v x %v %s\n", v.Name, v.Quantity.Value, v.Price.Value, currency[strings.ToLower(v.Price.Currency)])
for _, v := range msg.Data.Order.Items {
mb += fmt.Sprintf("%s %v x %v %s\n", v.Name, v.Quantity.Value, v.Price.Value, currency[strings.ToLower(v.Price.Currency)])
}
}