1
0
mirror of synced 2024-11-26 21:56:02 +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 ( var (
config *TransportConfig config *TransportConfig
orm *Orm orm *Orm
logger *logging.Logger logger *logging.Logger
options Options options Options
parser = flags.NewParser(&options, flags.Default) parser = flags.NewParser(&options, flags.Default)
rx = regexp.MustCompile(`/+$`) rx = regexp.MustCompile(`/+$`)
currency = map[string]string{ currency = map[string]string{
"rub": "₽", "rub": "₽",
"uah": "₴", "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) mb = fmt.Sprintf("\n%s", msg.Data.Product.Img)
} }
} else if msg.Data.Type == v1.MsgTypeOrder { } else if msg.Data.Type == v1.MsgTypeOrder {
mb = "**Заказ" mb = "**Заказ"
if msg.Data.Order.Number != ""{ if msg.Data.Order.Number != "" {
mb += " " + msg.Data.Order.Number mb += " " + msg.Data.Order.Number
} }
@ -527,8 +527,8 @@ func mgWebhookHandler(c *gin.Context) {
mb += "**\n" mb += "**\n"
if len(msg.Data.Order.Items) > 0 { if len(msg.Data.Order.Items) > 0 {
for _, v := range msg.Data.Order.Items { 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)]) mb += fmt.Sprintf("%s %v x %v %s\n", v.Name, v.Quantity.Value, v.Price.Value, currency[strings.ToLower(v.Price.Currency)])
} }
} }