From 8a1c3bee9691274aed907e890a179831e9aa7de0 Mon Sep 17 00:00:00 2001 From: yangduo Date: Fri, 21 Feb 2025 11:26:37 +0800 Subject: [PATCH] adjust --- bin/payserver/config/config.json | 4 +- bin/payserver/res/gamegoods/2004.json | 56 +++++++++++++++++++ .../api/v1/mainservice/mainservice.go | 3 +- server/payserver/service/wxpay.go | 14 +++++ 4 files changed, 74 insertions(+), 3 deletions(-) diff --git a/bin/payserver/config/config.json b/bin/payserver/config/config.json index 9f3a04f..538348e 100644 --- a/bin/payserver/config/config.json +++ b/bin/payserver/config/config.json @@ -10,6 +10,6 @@ "wx_msg_notify_token": "kingsome", "wx_msg_notify_encoding_aes_key": "2LO2BseGYDjPRK6xSf0Opv3PzWtOq2c3d8NhZHAVYbL", "wx_nofity_host": "https://payservice-test.kingsome.cn", - "wx_link_title": "点我充值", - "wx_link_description": "充值后返回游戏查看" + "wx_link_title": "点我购买", + "wx_link_description": "完成支付后返回游戏查看" } diff --git a/bin/payserver/res/gamegoods/2004.json b/bin/payserver/res/gamegoods/2004.json index 52bff7f..31f7da4 100644 --- a/bin/payserver/res/gamegoods/2004.json +++ b/bin/payserver/res/gamegoods/2004.json @@ -46,5 +46,61 @@ "type": 1, "price": 648, "count": 6480 + }, + { + "id": 7, + "name": "基础特惠礼包", + "icon": "10_106", + "type": 1, + "price": 648, + "count": 6480 + }, + { + "id": 8, + "name": "中级特惠礼包", + "icon": "10_106", + "type": 1, + "price": 648, + "count": 6480 + }, + { + "id": 9, + "name": "高级特惠礼包", + "icon": "10_106", + "type": 1, + "price": 648, + "count": 6480 + }, + { + "id": 10, + "name": "终极特惠礼包", + "icon": "10_106", + "type": 1, + "price": 648, + "count": 6480 + }, + { + "id": 11, + "name": "基础特权", + "icon": "10_106", + "type": 1, + "price": 648, + "count": 6480 + }, + { + "id": 12, + "name": "高级特权", + "icon": "10_106", + "type": 1, + "price": 648, + "count": 6480 + }, + { + "id": 13, + "name": "终极特权", + "icon": "10_106", + "type": 1, + "price": 648, + "count": 6480 } ] \ No newline at end of file diff --git a/server/payserver/api/v1/mainservice/mainservice.go b/server/payserver/api/v1/mainservice/mainservice.go index f2e0d19..06575db 100644 --- a/server/payserver/api/v1/mainservice/mainservice.go +++ b/server/payserver/api/v1/mainservice/mainservice.go @@ -362,6 +362,7 @@ func (this *MainServiceApi) WxMsgNotify(c *gin.Context) { } thumburl := service.Wxpay.GenThumburl(int64(orderModel.GameId)) + itemname, _ := service.Wxpay.GetGoodsName(int64(orderModel.GameId), int64(orderModel.ItemId)) // 发给客服系统的clicklink clickurl := fmt.Sprintf("%s/wx/clicknotify?orderid=%s", mt.Table.Config.GetWxNofityHost(), orderid) @@ -378,7 +379,7 @@ func (this *MainServiceApi) WxMsgNotify(c *gin.Context) { Url string `json:"url"` Thumb_url string `json:"thumb_url"` }{ - Title: mt.Table.Config.GetWxLinkTitle(), + Title: mt.Table.Config.GetWxLinkTitle() + " " + itemname, Description: mt.Table.Config.GetWxLinkDescription(), Url: clickurl, Thumb_url: thumburl, diff --git a/server/payserver/service/wxpay.go b/server/payserver/service/wxpay.go index f57d336..717c0a2 100644 --- a/server/payserver/service/wxpay.go +++ b/server/payserver/service/wxpay.go @@ -238,6 +238,20 @@ func (wp *wxpay) GetGoodsCount(gameid int64, goodsid int64) (count int64, err er return info.Count, nil } +func (wp *wxpay) GetGoodsName(gameid int64, goodsid int64) (name string, err error) { + goods, ok := wp.gamesGoods.Load(gameid) + if !ok { + return "", errors.New("no game") + } + + info, ok := (*goods)[goodsid] + if !ok { + return "", errors.New("no goods") + } + + return info.Name, nil +} + func (wp *wxpay) QueryBalance(openid string, gameid int64, userip string, sessionkey string) (balance int64, wxerrcode int32, err error) { cfg := mt.Table.Wxconfig.GetById(gameid) postbody := struct {