From 0f747c2578868f0a532518f37d8b0ee27ca4d429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Mon, 5 Aug 2024 16:42:25 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/http/controllers/front/payment_controller.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/http/controllers/front/payment_controller.go b/app/http/controllers/front/payment_controller.go index 75ed1b6..5f58686 100644 --- a/app/http/controllers/front/payment_controller.go +++ b/app/http/controllers/front/payment_controller.go @@ -32,7 +32,11 @@ func WxCallback(c *gin.Context) { var payChannelModel paychannelmodel.PayChannel payChannelIdInt, _ := strconv.Atoi(payChannelId) payChannelModel.Id = int64(payChannelIdInt) - services.PayChannelGet(&payChannelModel) + code := services.PayChannelGet(&payChannelModel) + if code == errorcode.PayChannelNotFound { + logger.Error(c, "AliCallback-回调数据未获取到支付配置,404") + c.String(http.StatusBadRequest, "%s", "fail") + } if payChannelModel.ChannelType != common.PAY_CHANNEL_WECHAT_H5 { logger.Error(c, "WxCallback-回调数据解析支付配置错误,查询的数据不是当前渠道") c.String(http.StatusBadRequest, "%s", "fail") @@ -81,14 +85,14 @@ func AliCallback(c *gin.Context) { payChannelIdInt, _ := strconv.Atoi(payChannelId) payChannelModel.Id = int64(payChannelIdInt) code := services.PayChannelGet(&payChannelModel) - if payChannelModel.ChannelType != common.PAY_CHANNEL_ALIPAY_WEB { - logger.Error(c, "AliCallback-回调数据解析支付配置错误,查询的数据不是当前渠道") - c.String(http.StatusBadRequest, "%s", "fail") - } if code == errorcode.PayChannelNotFound { logger.Error(c, "AliCallback-回调数据未获取到支付配置,404") c.String(http.StatusBadRequest, "%s", "fail") } + if payChannelModel.ChannelType != common.PAY_CHANNEL_ALIPAY_WEB { + logger.Error(c, "AliCallback-回调数据解析支付配置错误,查询的数据不是当前渠道") + c.String(http.StatusBadRequest, "%s", "fail") + } var aliConfig paymentService.AliPay var aliConfigModel struct { From 0ac4feb07a677ca604b44ed0f168cd16fd96a732 Mon Sep 17 00:00:00 2001 From: wolter Date: Mon, 5 Aug 2024 17:01:58 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=90=8E=E5=8F=B0=EF=BC=8C=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/constants/errorcode/error_code.go | 21 +++---- app/data/orders.go | 2 +- app/http/entities/backend/order.go | 72 +++++++++++------------- app/http/entities/backend/pay_channel.go | 14 ++--- app/services/order.go | 8 +-- 5 files changed, 57 insertions(+), 60 deletions(-) diff --git a/app/constants/errorcode/error_code.go b/app/constants/errorcode/error_code.go index e416628..2514e5c 100644 --- a/app/constants/errorcode/error_code.go +++ b/app/constants/errorcode/error_code.go @@ -47,16 +47,17 @@ var MsgEN = map[int]string{ } var MsgZH = map[int]string{ - Success: "请求成功", - ParamError: "参数错误", - NotFound: "数据不存在", - NotAuth: "未经授权", - NotLogin: "未登录", - RequestTimeOut: "请求超时", - MerchantNotFound: "商户不存在", - AppNotFound: "app_id未找到", - AppDisabled: "app通道关闭", - AppIpNotAllow: "ip不在白名单内", + Success: "请求成功", + ParamError: "参数错误", + NotFound: "数据不存在", + NotAuth: "未经授权", + NotLogin: "未登录", + RequestTimeOut: "请求超时", + MerchantNotFound: "商户不存在", + AppNotFound: "app_id未找到", + AppDisabled: "app通道关闭", + AppIpNotAllow: "ip不在白名单内", + SystemError: "系统错误", PayChannelNotFound: "支付方式不存在", } var MsgMap map[string]map[int]string = map[string]map[int]string{"en": MsgZH} diff --git a/app/data/orders.go b/app/data/orders.go index 9bc6c7e..8edec45 100644 --- a/app/data/orders.go +++ b/app/data/orders.go @@ -46,7 +46,7 @@ func (m *OrderRepo) OrdersBackendList(conn builder.Cond, pageFilter entities.Pag } repo = repo.Join("left", "app", "app.id = orders.app_id"). Join("left", "merchant", "merchant.id = orders.merchant_id"). - Join("left", "pay_channel", "pay_channel.id = orders.pay_id") + Join("left", "pay_channel", "pay_channel.id = orders.pay_channel_id") return repo.Desc("create_time").FindAndCount(orderList) } diff --git a/app/http/entities/backend/order.go b/app/http/entities/backend/order.go index 8ff87bd..ae5d5fa 100644 --- a/app/http/entities/backend/order.go +++ b/app/http/entities/backend/order.go @@ -12,27 +12,27 @@ import ( ) type OrderListRequest struct { - Id int64 `json:"id" form:"id"` - MerchantId int64 `json:"merchant_id" form:"merchant_id"` - PayId int64 `json:"pay_id" form:"pay_id"` - AppId int64 `json:"app_id" form:"app_id"` - MerchantOrderId string `json:"merchant_order_id" form:"merchant_order_id"` - Status int `json:"status" form:"status"` - OrderType int `json:"order_type" form:"order_type"` - StartTime string `json:"start_time" form:"start_time"` - EndTime string `json:"end_time" form:"end_time"` + Id int64 `json:"id" form:"id"` + MerchantId int64 `json:"merchant_id" form:"merchant_id"` + PayChannelId int64 `json:"pay_channel_id" form:"pay_channel_id"` + AppId int64 `json:"app_id" form:"app_id"` + OutTreadNo string `json:"out_tread_no" form:"out_tread_no"` + Status int `json:"status" form:"status"` + OrderType int `json:"order_type" form:"order_type"` + StartTime string `json:"start_time" form:"start_time"` + EndTime string `json:"end_time" form:"end_time"` entities.PageRequest } type OrderList struct { - Id int64 `json:"id"` - MerchantId int64 `json:"merchant_id"` - PayId int64 `json:"pay_id"` - AppId int64 `json:"app_id"` - MerchantOrderId string `json:"merchant_order_id"` - Status int `json:"status"` - OrderType int `json:"order_type"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` + Id int64 `json:"id"` + MerchantId int64 `json:"merchant_id"` + PayChannelId int64 `json:"pay_channel_id"` + AppId int64 `json:"app_id"` + OutTreadNo string `json:"out_tread_no"` + Status int `json:"status"` + OrderType int `json:"order_type"` + StartTime time.Time `json:"start_time"` + EndTime time.Time `json:"end_time"` entities.PageRequest } @@ -54,9 +54,9 @@ func (o *OrderListRequest) ValidateRequest() (r OrderList, err error) { r.Id = o.Id r.MerchantId = o.MerchantId - r.PayId = o.PayId + r.PayChannelId = o.PayChannelId r.AppId = o.AppId - r.MerchantOrderId = o.MerchantOrderId + r.OutTreadNo = o.OutTreadNo r.Status = o.Status r.OrderType = o.OrderType r.PageRequest = o.PageRequest @@ -65,24 +65,20 @@ func (o *OrderListRequest) ValidateRequest() (r OrderList, err error) { } type OrdersResponse struct { - Id int64 `json:"id"` - MerchantId int64 `json:"merchant_id"` - PayChannelId int64 `json:"pay_channel_id"` - AppId int64 `json:"app_id"` - OutTreadNo string `json:"out_tread_no"` - Status int `json:"status"` - OrderType int `json:"order_type"` - Amount int `json:"amount"` - IpAddress string `json:"ip_address"` - MerchantRequest string `json:"merchant_request"` - MerchantResponse string `json:"merchant_response"` - OrderResponse string `json:"order_response"` - ExtJson string `json:"ext_json"` - CreateTime string `json:"create_time"` - UpdateTime string `json:"update_time"` - MerchantName string `json:"merchant_name"` - PayName string `json:"pay_name"` - AppName string `json:"app_name"` + Id int64 `json:"id"` + MerchantId int64 `json:"merchant_id"` + PayChannelId int64 `json:"pay_channel_id"` + AppId int64 `json:"app_id"` + OutTreadNo string `json:"out_tread_no"` + Status int `json:"status"` + OrderType int `json:"order_type"` + Amount int `json:"amount"` + ExtJson string `json:"ext_json"` + CreateTime string `json:"create_time"` + UpdateTime string `json:"update_time"` + MerchantName string `json:"merchant_name"` + PayName string `json:"pay_name"` + AppName string `json:"app_name"` } func (o *OrdersResponse) ResponseFromDb(db ordersmodel.OrdersBackendList) { diff --git a/app/http/entities/backend/pay_channel.go b/app/http/entities/backend/pay_channel.go index 2fe10aa..4416175 100644 --- a/app/http/entities/backend/pay_channel.go +++ b/app/http/entities/backend/pay_channel.go @@ -17,7 +17,7 @@ type PayChannelResponse struct { AppId string `json:"app_id"` ExpireTime string `json:"expire_time"` CreateTime string `json:"create_time"` - AliPayPayChannel *AliPayPayChannel `json:"ali_pay_pay_channel,omitempty"` + AliPayChannel *AliPayChannel `json:"ali_pay_channel,omitempty"` WechatPayChannel *WechatPayChannel `json:"wechat_pay_channel,omitempty"` } @@ -34,7 +34,7 @@ func (p *PayChannelResponse) ResponseFromDb(db paychannelmodel.PayChannel) { case common.PAY_CHANNEL_WECHAT_H5, common.PAY_CHANNEL_WECHAT_JSAPI, common.PAY_CHANNEL_WECHAT_NATIVE, common.PAY_CHANNEL_WECHAT_APP, common.PAY_CHANNEL_WECHAT_MINI: _ = json.Unmarshal([]byte(db.ExtJson), &p.WechatPayChannel) case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI: - _ = json.Unmarshal([]byte(db.ExtJson), &p.AliPayPayChannel) + _ = json.Unmarshal([]byte(db.ExtJson), &p.AliPayChannel) } } @@ -44,7 +44,7 @@ type PayChannelCreateRequest struct { ChannelType int `json:"channel_type" validate:"required" label:"支付渠道"` //支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI AppId string `json:"app_id" validate:"required" label:"应用appId"` ExpireTime string `json:"expire_time"` - AliPayPayChannel AliPayPayChannel `json:"ali_pay_pay_channel,omitempty"` + AliPayChannel AliPayChannel `json:"ali_pay_channel,omitempty"` WechatPayChannel WechatPayChannel `json:"wechat_pay_channel,omitempty"` } @@ -55,7 +55,7 @@ type WechatPayChannel struct { PrivateKey string `json:"private_key"` // 私钥 apiclient_key.pem 读取后的内容 } -type AliPayPayChannel struct { +type AliPayChannel struct { PrivateKey string `json:"private_key"` // 应用私钥 AppPublicCert string `json:"app_public_cert"` // 应用公钥 AlipayRootCert string `json:"alipay_root_cert"` // 支付宝根证书 @@ -78,7 +78,7 @@ func (p *PayChannelCreateRequest) RequestToDb() (db paychannelmodel.PayChannel, b, _ := json.Marshal(p.WechatPayChannel) db.ExtJson = string(b) case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI: - b, _ := json.Marshal(p.AliPayPayChannel) + b, _ := json.Marshal(p.AliPayChannel) db.ExtJson = string(b) default: err = errors.New("支付渠道类型错误") @@ -98,7 +98,7 @@ type PayChannelUpdateRequest struct { ChannelType int `json:"channel_type" validate:"required" label:"支付渠道"` //支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI AppId string `json:"app_id" validate:"required" label:"应用appId"` ExpireTime string `json:"expire_time"` - AliPayPayChannel AliPayPayChannel `json:"ali_pay_pay_channel,omitempty"` + AliPayChannel AliPayChannel `json:"ali_pay_channel,omitempty"` WechatPayChannel WechatPayChannel `json:"wechat_pay_channel,omitempty"` } @@ -118,7 +118,7 @@ func (p PayChannelUpdateRequest) RequestToDb() (db paychannelmodel.PayChannel, e b, _ := json.Marshal(p.WechatPayChannel) db.ExtJson = string(b) case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI: - b, _ := json.Marshal(p.AliPayPayChannel) + b, _ := json.Marshal(p.AliPayChannel) db.ExtJson = string(b) default: err = errors.New("支付渠道类型错误") diff --git a/app/services/order.go b/app/services/order.go index c653105..fa7e3ca 100644 --- a/app/services/order.go +++ b/app/services/order.go @@ -21,14 +21,14 @@ func OrderList(req backend.OrderList) (result []ordersmodel.OrdersBackendList, t if req.MerchantId > 0 { conn = conn.And(builder.Eq{"merchant_id": req.MerchantId}) } - if req.PayId > 0 { - conn = conn.And(builder.Eq{"pay_id": req.PayId}) + if req.PayChannelId > 0 { + conn = conn.And(builder.Eq{"pay_channel_id": req.PayChannelId}) } if req.AppId > 0 { conn = conn.And(builder.Eq{"app_id": req.AppId}) } - if req.MerchantOrderId != "" { - conn = conn.And(builder.Like{"merchant_order_id", req.MerchantOrderId}) + if req.OutTreadNo != "" { + conn = conn.And(builder.Like{"out_tread_no", req.OutTreadNo}) } if req.Status > 0 { conn = conn.And(builder.Eq{"status": req.Status}) From 50382f2c0abd00d1120f322682f6dd9716c71861 Mon Sep 17 00:00:00 2001 From: wolter Date: Mon, 5 Aug 2024 17:51:57 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=90=8E=E5=8F=B0=EF=BC=8C=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=9F=A5=E8=AF=A2=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=92=8C=E5=85=B3=E9=97=AD=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/console/command.go | 91 ++++++++++++++++++++++++++++------ app/constants/common/common.go | 3 ++ app/data/orders.go | 4 +- app/utils/util.go | 12 +++++ 4 files changed, 92 insertions(+), 18 deletions(-) diff --git a/app/console/command.go b/app/console/command.go index fb8e8de..0573b93 100644 --- a/app/console/command.go +++ b/app/console/command.go @@ -4,6 +4,7 @@ import ( "PaymentCenter/app/constants/common" "PaymentCenter/app/data" "PaymentCenter/app/http/entities" + "PaymentCenter/app/http/entities/backend" "PaymentCenter/app/models/ordersmodel" "PaymentCenter/app/models/orderthirdpaylogmodel" "PaymentCenter/app/third/paymentService" @@ -28,20 +29,59 @@ func RegisterCommand(c *command.Command) { func closeOrder() { var now = time.Now().Format(time.DateTime) utils.Log(nil, "关闭订单", now) + var ctx = context.Background() + orderIds := make([]int64, 0) // 查询未支付的订单 repo := data.NewOrderRepo(ordersmodel.GetInstance().GetDb()) // 拼接条件 cond := builder.NewCond() - cond = cond.And(builder.Eq{"status": common.ORDER_STATUS_PAYING}, builder.Lt{"create_time": time.Now().Add(-time.Second * time.Duration(config.GetConf().CronConfig.CloseOrderTime))}) - - order := make([]ordersmodel.Orders, 0) - total, err := repo.OrderList(cond, entities.PageRequest{}, &order) + cond = cond.And(builder.Eq{"status": common.ORDER_STATUS_PAYING}, builder.Lt{"orders.create_time": time.Now().Add(-time.Second * time.Duration(config.GetConf().CronConfig.CloseOrderTime))}) + // 查询订单 + order := make([]ordersmodel.OrdersLeftPayChannelList, 0) + err := repo.OrdersLeftPayChannelList(cond, entities.PageRequest{}, &order) if err != nil { utils.Log(nil, "关闭订单,查询未支付订单失败", err) - } else if total > 0 { - orderIds := make([]int64, 0) - for _, v := range order { - orderIds = append(orderIds, v.Id) + } else if len(order) > 0 { + for i := range order { + orderInfo := order[i] + // 往上游发送关闭订单请求 + req := paymentService.OrderCloseRequest{OrderId: orderInfo.Id} + + switch utils.PayType(orderInfo.ChannelType) { + case common.PAY_CHANNLE_TYPE_WECHAT: + wx := backend.WechatPayChannel{} + _ = json.Unmarshal([]byte(orderInfo.ExtJson), &wx) + req.PayChannel = payCommon.PAY_CHANNLE_TYPE_WECHAT + req.Wx = paymentService.WxPay{ + AppId: orderInfo.AppId, + MchId: wx.MchId, + SerialNo: wx.SerialNo, + ApiV3Key: wx.ApiV3Key, + PrivateKey: wx.PrivateKey, + } + case common.PAY_CHANNLE_TYPE_ZFB: + ali := backend.AliPayChannel{} + req.PayChannel = payCommon.PAY_CHANNLE_TYPE_ZFB + _ = json.Unmarshal([]byte(orderInfo.ExtJson), &ali) + req.Ali = paymentService.AliPay{ + AppId: orderInfo.AppId, + PrivateKey: ali.PrivateKey, + AppPublicCert: []byte(ali.AppPublicCert), + AlipayRootCert: []byte(ali.AlipayRootCert), + AlipayPublicCert: []byte(ali.AlipayPublicCert), + } + default: + utils.Log(nil, "关闭订单,支付渠道不支持", orderInfo.ChannelType) + continue + } + // 发起关闭订单请求 + response := paymentService.OrderClose(ctx, req) + // 成功 + if response.Code == payCommon.PAY_SUCCESS_CODE { + orderIds = append(orderIds, orderInfo.Id) + } else { + utils.Log(nil, "关闭订单,上游支付失败", response) + } } // 修改订单状态为关闭 cond = builder.NewCond() @@ -52,7 +92,7 @@ func closeOrder() { return } } - utils.Log(nil, "关闭订单,修改订单状态成功", "count="+strconv.Itoa(len(order))) + utils.Log(nil, "关闭订单,修改订单状态成功", "总数量="+strconv.Itoa(len(order)), "成功数量="+strconv.Itoa(len(orderIds))) } // 主动查询订单支付状态 @@ -64,7 +104,6 @@ func queryOrder() { repo := data.NewOrderRepo(ordersmodel.GetInstance().GetDb()) // 拼接条件 cond := builder.NewCond() - config.GetConf() cond = cond.And(builder.Eq{"status": common.ORDER_STATUS_PAYING}, builder.Gt{"orders.create_time": time.Now().Add(-time.Second * time.Duration(config.GetConf().CronConfig.QueryOrderTime))}) order := make([]ordersmodel.OrdersLeftPayChannelList, 0) err := repo.OrdersLeftPayChannelList(cond, entities.PageRequest{}, &order) @@ -90,13 +129,32 @@ func queryOrder() { query := paymentService.PayOrderQueryRequest{ OrderId: orderInfo.Id, } - switch orderInfo.ChannelType { - case common.PAY_CHANNEL_WECHAT_H5, common.PAY_CHANNEL_WECHAT_JSAPI, common.PAY_CHANNEL_WECHAT_NATIVE, common.PAY_CHANNEL_WECHAT_APP, common.PAY_CHANNEL_WECHAT_MINI: - _ = json.Unmarshal([]byte(orderInfo.ExtJson), &query.Wx) + switch utils.PayType(orderInfo.ChannelType) { + case common.PAY_CHANNLE_TYPE_WECHAT: + wx := backend.WechatPayChannel{} + _ = json.Unmarshal([]byte(orderInfo.ExtJson), &wx) query.PayChannel = payCommon.PAY_CHANNLE_TYPE_WECHAT - case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI: + query.Wx = paymentService.WxPay{ + AppId: orderInfo.AppId, + MchId: wx.MchId, + SerialNo: wx.SerialNo, + ApiV3Key: wx.ApiV3Key, + PrivateKey: wx.PrivateKey, + } + case common.PAY_CHANNLE_TYPE_ZFB: + ali := backend.AliPayChannel{} query.PayChannel = payCommon.PAY_CHANNLE_TYPE_ZFB - _ = json.Unmarshal([]byte(orderInfo.ExtJson), &query.Ali) + _ = json.Unmarshal([]byte(orderInfo.ExtJson), &ali) + query.Ali = paymentService.AliPay{ + AppId: orderInfo.AppId, + PrivateKey: ali.PrivateKey, + AppPublicCert: []byte(ali.AppPublicCert), + AlipayRootCert: []byte(ali.AlipayRootCert), + AlipayPublicCert: []byte(ali.AlipayPublicCert), + } + default: + utils.Log(nil, "查询订单,支付渠道不支持", orderInfo.ChannelType) + return } // 发起查询 @@ -152,9 +210,10 @@ func queryOrder() { } // 写入日志 + body, _ := json.Marshal(result) log := orderthirdpaylogmodel.OrderThirdPayLog{ OrderId: orderInfo.Id, - PayCallback: "", + PayCallback: string(body), Status: 0, MerchantParam: "", MerchantCallback: "", diff --git a/app/constants/common/common.go b/app/constants/common/common.go index 6439c26..cfe21f3 100644 --- a/app/constants/common/common.go +++ b/app/constants/common/common.go @@ -28,4 +28,7 @@ const ( ORDER_STATUS_PAYED = 3 ORDER_STATUS_FAILED = 4 ORDER_STATUS_CLOSE = 5 + + PAY_CHANNLE_TYPE_WECHAT = 1 // 支付类型: 微信 + PAY_CHANNLE_TYPE_ZFB = 2 // 支付类型:支付宝 ) diff --git a/app/data/orders.go b/app/data/orders.go index 8edec45..ff7fd6c 100644 --- a/app/data/orders.go +++ b/app/data/orders.go @@ -47,7 +47,7 @@ func (m *OrderRepo) OrdersBackendList(conn builder.Cond, pageFilter entities.Pag repo = repo.Join("left", "app", "app.id = orders.app_id"). Join("left", "merchant", "merchant.id = orders.merchant_id"). Join("left", "pay_channel", "pay_channel.id = orders.pay_channel_id") - return repo.Desc("create_time").FindAndCount(orderList) + return repo.Desc("orders.create_time").FindAndCount(orderList) } func (m *OrderRepo) OrdersLeftPayChannelList(conn builder.Cond, pageFilter entities.PageRequest, orderList *[]ordersmodel.OrdersLeftPayChannelList) error { @@ -56,6 +56,6 @@ func (m *OrderRepo) OrdersLeftPayChannelList(conn builder.Cond, pageFilter entit if pageFilter.Page > 0 { repo = repo.Limit(pageFilter.PageSize, pageFilter.PageSize*(pageFilter.Page-1)) } - repo = repo.Join("left", "pay_channel", "pay_channel.id = orders.pay_id") + repo = repo.Join("left", "pay_channel", "pay_channel.id = orders.pay_channel_id") return repo.Find(orderList) } diff --git a/app/utils/util.go b/app/utils/util.go index 9427626..c5e9473 100644 --- a/app/utils/util.go +++ b/app/utils/util.go @@ -450,3 +450,15 @@ func SliceInStr(s string, slice []string) bool { } return false } + +// 判断支付方式支付宝或者微信 +func PayType(payChannel int) int { + switch payChannel { + case common.PAY_CHANNEL_WECHAT_H5, common.PAY_CHANNEL_WECHAT_JSAPI, common.PAY_CHANNEL_WECHAT_NATIVE, common.PAY_CHANNEL_WECHAT_APP, common.PAY_CHANNEL_WECHAT_MINI: + return common.PAY_CHANNLE_TYPE_WECHAT + case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI: + return common.PAY_CHANNLE_TYPE_ZFB + default: + return 0 + } +} From 9f052435cc920955fe99cf93102c3ca1bdfdaef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 10:22:03 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/constants/common/common.go | 2 +- app/http/routes/route.go | 3 +- app/third/paymentService/ali_service.go | 9 +++-- app/third/paymentService/payCommon/common.go | 12 +++---- app/third/paymentService/payment_test.go | 38 ++++++++++---------- app/third/paymentService/wechat_service.go | 6 ++-- config/config.go | 7 ++++ 7 files changed, 45 insertions(+), 32 deletions(-) diff --git a/app/constants/common/common.go b/app/constants/common/common.go index cfe21f3..7c2c42a 100644 --- a/app/constants/common/common.go +++ b/app/constants/common/common.go @@ -4,7 +4,7 @@ const ( TOKEN_PRE = "player_token_" TOKEN_Admin = "Admin_token_" ADMIN_V1 = "/pay/admin/api/v1" - FRONT_V1 = "/api/v1" + FRONT_V1 = "/pay/front/api/v1" // 支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI PAY_CHANNEL_UNKNOWN = 0 diff --git a/app/http/routes/route.go b/app/http/routes/route.go index e0dc7ff..4761514 100644 --- a/app/http/routes/route.go +++ b/app/http/routes/route.go @@ -4,6 +4,7 @@ package routes * 配置路由 */ import ( + "PaymentCenter/app/constants/common" "PaymentCenter/app/http/controllers" "PaymentCenter/app/http/controllers/backend" "PaymentCenter/app/http/controllers/front" @@ -47,7 +48,7 @@ func RegisterRoute(router *gin.Engine) { //router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) - v1 := router.Group("/v1") + v1 := router.Group(common.FRONT_V1) { //回调处理 notify := v1.Group("/notify") diff --git a/app/third/paymentService/ali_service.go b/app/third/paymentService/ali_service.go index df3e6a7..80ff103 100644 --- a/app/third/paymentService/ali_service.go +++ b/app/third/paymentService/ali_service.go @@ -2,6 +2,7 @@ package paymentService import ( "PaymentCenter/app/third/paymentService/payCommon" + "PaymentCenter/config" "context" "errors" "fmt" @@ -20,12 +21,13 @@ var ( // AliInitClient 使用提供的支付请求参数初始化支付宝客户端 func AliInitClient(aliConfig AliPay) { + envConfig := config.GetConf() aliOnce.Do(func() { // 初始化支付宝客户端 // appid:应用ID // privateKey:应用私钥,支持PKCS1和PKCS8 // isProd:是否是正式环境,沙箱环境请选择新版沙箱应用。 - aliClient, aliClientErr = alipay.NewClient(aliConfig.AppId, aliConfig.PrivateKey, true) + aliClient, aliClientErr = alipay.NewClient(aliConfig.AppId, aliConfig.PrivateKey, envConfig.PayService.IsProd) }) // 自定义配置http请求接收返回结果body大小,默认 10MB aliClient.SetBodySize(10) // 没有特殊需求,可忽略此配置 @@ -72,12 +74,13 @@ func ALiH5PayInfo(c context.Context, payOrderRequest PayOrderRequest) (string, e // 初始化 BodyMap amount := float64(payOrderRequest.Amount) / 100.0 + envConfig := config.GetConf() bm := make(gopay.BodyMap) bm.Set("out_trade_no", payOrderRequest.OrderId). Set("total_amount", amount). Set("subject", payOrderRequest.Description). - //Set("notify_url", fmt.Sprintf(payCommon.ALI_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)). - Set("notify_url", fmt.Sprintf(payCommon.ALI_NOTIFY_URL_PROD+"%d", payOrderRequest.PayChannelId)) + Set("notify_url", fmt.Sprintf(envConfig.PayService.TestHost+payCommon.ALI_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)) + //Set("notify_url", fmt.Sprintf(envConfig.PayService.ProdHost+payCommon.ALI_NOTIFY_URL_PROD+"%d", payOrderRequest.PayChannelId)) aliRsp, err := aliClient.TradeWapPay(c, bm) if err != nil { diff --git a/app/third/paymentService/payCommon/common.go b/app/third/paymentService/payCommon/common.go index bf2c8c5..cc6d229 100644 --- a/app/third/paymentService/payCommon/common.go +++ b/app/third/paymentService/payCommon/common.go @@ -1,8 +1,8 @@ package payCommon +import "PaymentCenter/app/constants/common" + const ( - TEST_URL = "" - PROD_URL = "" // 支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI PAY_CHANNEL_UNKNOWN = 0 @@ -21,10 +21,10 @@ const ( WX_SUCCESS_CODE = 200 // 微信状态码返回成功 - WX_NOTIFY_URL_TEST = TEST_URL + "/v1/notify/wx/" // 微信支付回调地址 - WX_NOTIFY_URL_PROD = PROD_URL + "/v1/notify/wx/" // 微信支付回调地址 - ALI_NOTIFY_URL_TEST = TEST_URL + "/v1/notify/ali/" // 支付宝支付回调地址 - ALI_NOTIFY_URL_PROD = PROD_URL + "/v1/notify/ali/" // 支付宝支付回调地址 + WX_NOTIFY_URL_TEST = common.FRONT_V1 + "/notify/wx/" // 微信支付回调地址 + WX_NOTIFY_URL_PROD = common.FRONT_V1 + "/notify/wx/" // 微信支付回调地址 + ALI_NOTIFY_URL_TEST = common.FRONT_V1 + "/notify/ali/" // 支付宝支付回调地址 + ALI_NOTIFY_URL_PROD = common.FRONT_V1 + "/notify/ali/" // 支付宝支付回调地址 ORDER_NO_TYPE_ORDER_NO = 2 diff --git a/app/third/paymentService/payment_test.go b/app/third/paymentService/payment_test.go index 0e39b97..308e3f2 100644 --- a/app/third/paymentService/payment_test.go +++ b/app/third/paymentService/payment_test.go @@ -1,12 +1,16 @@ package paymentService import ( + "PaymentCenter/app/utils" + "PaymentCenter/config" "context" "crypto/md5" "encoding/hex" "encoding/pem" "errors" + "fmt" "github.com/go-pay/gopay" + "github.com/qit-team/snow-core/kernel/server" "github.com/tjfoc/gmsm/x509" "os" "strings" @@ -15,22 +19,18 @@ import ( func TestMarketSendRequest_Market(t *testing.T) { c := context.Background() - //appCertPath := "appCertPublicKey_2021003140624267.crt" // 应用公钥证书 - //aliPayPublicCertPath := "alipayCertPublicKey_RSA2.crt" // 支付宝公钥证书 - //aliPayRootCertPath := "alipayRootCert.crt" // 支付宝根证书 - //sn, err := GetCertSN(appCertPath) - //getCertSN, err := GetCertSN(aliPayPublicCertPath) - //if err != nil { - // return - //} - //certSN, err := GetRootCertSN(aliPayRootCertPath) - //if err != nil { - // return - //} - //if err != nil { - // return - //} + opts := config.GetOptions() + if opts.ShowVersion { + fmt.Printf("%s\ncommit %s\nbuilt on %s\n", server.Version, server.BuildCommit, server.BuildDate) + os.Exit(0) + } + //加载配置 + _, err := config.Load(opts.ConfFile) + if err != nil { + utils.Log(nil, "err", err.Error()) + return + } request := PayOrderRequest{ OrderId: 12312312312, ChannelType: 6, @@ -38,11 +38,11 @@ func TestMarketSendRequest_Market(t *testing.T) { Amount: 1, PayerClientIp: "192.168.110.235", Ali: AliPay{ - AppId: "2021003140624267", - PrivateKey: "MIIEvAIBADANBgkqhkiG9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QDDDVBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y\naXR5IENsYXNzIDIgUjEgdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMh4FKYO\nZyRQHD6eFbPKZeSAnrfjfU7xmS9Yoozuu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC\n5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), }, } PaymentService(c, request) diff --git a/app/third/paymentService/wechat_service.go b/app/third/paymentService/wechat_service.go index f7c9b03..40db8b4 100644 --- a/app/third/paymentService/wechat_service.go +++ b/app/third/paymentService/wechat_service.go @@ -2,6 +2,7 @@ package paymentService import ( "PaymentCenter/app/third/paymentService/payCommon" + "PaymentCenter/config" "context" "errors" "fmt" @@ -67,14 +68,15 @@ func WxH5PayInfo(c context.Context, payOrderRequest PayOrderRequest) (string, er } expire := time.Now().Add(10 * time.Minute).Format(time.RFC3339) // 初始化 BodyMap + envConfig := config.GetConf() bm := make(gopay.BodyMap) bm.Set("appid", payOrderRequest.Wx.AppId). Set("mchid", payOrderRequest.Wx.MchId). Set("description", payOrderRequest.Description). Set("out_trade_no", payOrderRequest.OrderId). Set("time_expire", expire). - //Set("notify_url", fmt.Sprintf(payCommon.WX_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)). - Set("notify_url", fmt.Sprintf(payCommon.WX_NOTIFY_URL_PROD+"%d", payOrderRequest.PayChannelId)). + Set("notify_url", fmt.Sprintf(envConfig.PayService.TestHost+payCommon.WX_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)). + //Set("notify_url", fmt.Sprintf(envConfig.PayService.ProdHost+payCommon.WX_NOTIFY_URL_PROD+"%d", payOrderRequest.PayChannelId)). SetBodyMap("amount", func(bm gopay.BodyMap) { bm.Set("total", payOrderRequest.Amount). Set("currency", "CNY") diff --git a/config/config.go b/config/config.go index be54a4e..8b6c72d 100644 --- a/config/config.go +++ b/config/config.go @@ -39,6 +39,7 @@ type Config struct { AliOss AliOss `toml:"AliOss"` AdminGate []string `toml:"AdminGate"` CronConfig CronConfig `toml:"CronConfig"` + PayService PayService `toml:"PayService"` } type AliOss struct { @@ -91,6 +92,12 @@ type CronConfig struct { ConcurrentNumber int `toml:"ConcurrentNumber"` } +type PayService struct { + TestHost string `toml:"TestHost"` + ProdHost string `toml:"ProdHost"` + IsProd bool `toml:"IsProd"` +} + func newConfig() *Config { return new(Config) } From e8576d67d9c3609dc85e47f37926dd11286776c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 10:35:30 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/third/paymentService/ali_service.go | 3 +-- app/third/paymentService/payment_test.go | 13 ++++++++++--- app/third/paymentService/wechat_service.go | 3 +-- config/config.go | 5 ++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/third/paymentService/ali_service.go b/app/third/paymentService/ali_service.go index 80ff103..df76b20 100644 --- a/app/third/paymentService/ali_service.go +++ b/app/third/paymentService/ali_service.go @@ -79,8 +79,7 @@ func ALiH5PayInfo(c context.Context, payOrderRequest PayOrderRequest) (string, e bm.Set("out_trade_no", payOrderRequest.OrderId). Set("total_amount", amount). Set("subject", payOrderRequest.Description). - Set("notify_url", fmt.Sprintf(envConfig.PayService.TestHost+payCommon.ALI_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)) - //Set("notify_url", fmt.Sprintf(envConfig.PayService.ProdHost+payCommon.ALI_NOTIFY_URL_PROD+"%d", payOrderRequest.PayChannelId)) + Set("notify_url", fmt.Sprintf(envConfig.PayService.Host+payCommon.ALI_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)) aliRsp, err := aliClient.TradeWapPay(c, bm) if err != nil { diff --git a/app/third/paymentService/payment_test.go b/app/third/paymentService/payment_test.go index 308e3f2..819a96e 100644 --- a/app/third/paymentService/payment_test.go +++ b/app/third/paymentService/payment_test.go @@ -1,7 +1,7 @@ package paymentService import ( - "PaymentCenter/app/utils" + "PaymentCenter/bootstrap" "PaymentCenter/config" "context" "crypto/md5" @@ -19,6 +19,7 @@ import ( func TestMarketSendRequest_Market(t *testing.T) { c := context.Background() + //解析启动命令 opts := config.GetOptions() if opts.ShowVersion { fmt.Printf("%s\ncommit %s\nbuilt on %s\n", server.Version, server.BuildCommit, server.BuildDate) @@ -26,11 +27,17 @@ func TestMarketSendRequest_Market(t *testing.T) { } //加载配置 - _, err := config.Load(opts.ConfFile) + opts.ConfFile = "../../../.env" + conf, err := config.Load(opts.ConfFile) if err != nil { - utils.Log(nil, "err", err.Error()) return } + //引导程序 + err = bootstrap.Bootstrap(conf) + if err != nil { + return + } + request := PayOrderRequest{ OrderId: 12312312312, ChannelType: 6, diff --git a/app/third/paymentService/wechat_service.go b/app/third/paymentService/wechat_service.go index 40db8b4..da0eb77 100644 --- a/app/third/paymentService/wechat_service.go +++ b/app/third/paymentService/wechat_service.go @@ -75,8 +75,7 @@ func WxH5PayInfo(c context.Context, payOrderRequest PayOrderRequest) (string, er Set("description", payOrderRequest.Description). Set("out_trade_no", payOrderRequest.OrderId). Set("time_expire", expire). - Set("notify_url", fmt.Sprintf(envConfig.PayService.TestHost+payCommon.WX_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)). - //Set("notify_url", fmt.Sprintf(envConfig.PayService.ProdHost+payCommon.WX_NOTIFY_URL_PROD+"%d", payOrderRequest.PayChannelId)). + Set("notify_url", fmt.Sprintf(envConfig.PayService.Host+payCommon.WX_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)). SetBodyMap("amount", func(bm gopay.BodyMap) { bm.Set("total", payOrderRequest.Amount). Set("currency", "CNY") diff --git a/config/config.go b/config/config.go index 8b6c72d..c9a2848 100644 --- a/config/config.go +++ b/config/config.go @@ -93,9 +93,8 @@ type CronConfig struct { } type PayService struct { - TestHost string `toml:"TestHost"` - ProdHost string `toml:"ProdHost"` - IsProd bool `toml:"IsProd"` + Host string `toml:"TestHost"` + IsProd bool `toml:"IsProd"` } func newConfig() *Config { From 74d1472a43408f0b076c768a6ed765f73889b33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 11:09:39 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/third/paymentService/payment_test.go | 8 +------- config/config.go | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/third/paymentService/payment_test.go b/app/third/paymentService/payment_test.go index 819a96e..07dab2b 100644 --- a/app/third/paymentService/payment_test.go +++ b/app/third/paymentService/payment_test.go @@ -1,7 +1,6 @@ package paymentService import ( - "PaymentCenter/bootstrap" "PaymentCenter/config" "context" "crypto/md5" @@ -28,12 +27,7 @@ func TestMarketSendRequest_Market(t *testing.T) { //加载配置 opts.ConfFile = "../../../.env" - conf, err := config.Load(opts.ConfFile) - if err != nil { - return - } - //引导程序 - err = bootstrap.Bootstrap(conf) + _, err := config.Load(opts.ConfFile) if err != nil { return } diff --git a/config/config.go b/config/config.go index c9a2848..50bf34b 100644 --- a/config/config.go +++ b/config/config.go @@ -93,7 +93,7 @@ type CronConfig struct { } type PayService struct { - Host string `toml:"TestHost"` + Host string `toml:"Host"` IsProd bool `toml:"IsProd"` } From 6adcce148007f9b7ecc643e504cdfb07d045f9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 11:19:13 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/front/payment_controller.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/http/controllers/front/payment_controller.go b/app/http/controllers/front/payment_controller.go index 5f58686..4613a93 100644 --- a/app/http/controllers/front/payment_controller.go +++ b/app/http/controllers/front/payment_controller.go @@ -12,7 +12,6 @@ import ( "github.com/go-pay/gopay" "github.com/go-pay/gopay/alipay" "github.com/go-pay/gopay/wechat/v3" - "github.com/go-pay/xlog" "github.com/qit-team/snow-core/log/logger" "strconv" @@ -26,6 +25,7 @@ func WxCallback(c *gin.Context) { logger.Info(c, "WxCallback-回调数据payChannelId", payChannelId) if payChannelId == "" { c.String(http.StatusBadRequest, "%s", "fail") + return } // 查询应用下的支付配置 @@ -36,10 +36,12 @@ func WxCallback(c *gin.Context) { if code == errorcode.PayChannelNotFound { logger.Error(c, "AliCallback-回调数据未获取到支付配置,404") c.String(http.StatusBadRequest, "%s", "fail") + return } if payChannelModel.ChannelType != common.PAY_CHANNEL_WECHAT_H5 { logger.Error(c, "WxCallback-回调数据解析支付配置错误,查询的数据不是当前渠道") c.String(http.StatusBadRequest, "%s", "fail") + return } var wxConfig paymentService.WxPay @@ -47,22 +49,26 @@ func WxCallback(c *gin.Context) { if err != nil { logger.Error(c, "WxCallback-回调数据解析支付配置错误", fmt.Sprintf("错误原因:%s", err.Error())) c.String(http.StatusBadRequest, "%s", "fail") + return } if wxConfig.ApiV3Key == "" || wxConfig.MchId == "" || wxConfig.PrivateKey == "" || wxConfig.SerialNo == "" { logger.Error(c, "WxCallback-回调数据解析支付配置错误,解析出来的信息为空") c.String(http.StatusBadRequest, "%s", "fail") + return } wxConfig.AppId = payChannelModel.AppId notifyReq, err := wechat.V3ParseNotify(c.Request) if err != nil { logger.Error(c, "WxCallback-回调数据验签失败", err.Error()) + c.String(http.StatusBadRequest, "%s", "fail") return } err = paymentService.WxPayCallBack(notifyReq, wxConfig) if err != nil { logger.Error(c, "WxCallback-回调执行失败,失败原因:", err.Error()) + c.String(http.StatusBadRequest, "%s", "fail") return } @@ -70,6 +76,7 @@ func WxCallback(c *gin.Context) { // 退款通知http应答码为200且返回状态码为SUCCESS才会当做商户接收成功,否则会重试。 // 注意:重试过多会导致微信支付端积压过多通知而堵塞,影响其他正常通知。 c.JSON(http.StatusOK, &wechat.V3NotifyRsp{Code: gopay.SUCCESS, Message: "成功"}) + return } // AliCallback 支付宝支付回调 @@ -79,6 +86,7 @@ func AliCallback(c *gin.Context) { logger.Info(c, "AliCallback-回调数据APPID", payChannelId) if payChannelId == "" { c.String(http.StatusBadRequest, "%s", "fail") + return } // 查询应用下的支付配置 var payChannelModel paychannelmodel.PayChannel @@ -88,10 +96,12 @@ func AliCallback(c *gin.Context) { if code == errorcode.PayChannelNotFound { logger.Error(c, "AliCallback-回调数据未获取到支付配置,404") c.String(http.StatusBadRequest, "%s", "fail") + return } if payChannelModel.ChannelType != common.PAY_CHANNEL_ALIPAY_WEB { logger.Error(c, "AliCallback-回调数据解析支付配置错误,查询的数据不是当前渠道") c.String(http.StatusBadRequest, "%s", "fail") + return } var aliConfig paymentService.AliPay @@ -105,10 +115,12 @@ func AliCallback(c *gin.Context) { if err != nil { logger.Error(c, "AliCallback-回调数据解析支付配置错误", fmt.Sprintf("错误原因:%s", err.Error())) c.String(http.StatusBadRequest, "%s", "fail") + return } if aliConfigModel.AlipayPublicCert == "" || aliConfigModel.PrivateKey == "" || aliConfigModel.AppPublicCert == "" || aliConfigModel.AlipayRootCert == "" { logger.Error(c, "AliCallback-回调数据解析支付配置错误,解析出来的信息为空") c.String(http.StatusBadRequest, "%s", "fail") + return } aliConfig.AppId = payChannelModel.AppId aliConfig.PrivateKey = aliConfigModel.PrivateKey @@ -118,14 +130,16 @@ func AliCallback(c *gin.Context) { notifyReq, err := alipay.ParseNotifyToBodyMap(c.Request) // c.Request 是 gin 框架的写法 if err != nil { - xlog.Error(err) + c.String(http.StatusBadRequest, "%s", "fail") return } err = paymentService.ALiCallBack(notifyReq, aliConfig) if err != nil { logger.Error(c, "AliCallback-回调执行失败,失败原因:", err.Error()) + c.String(http.StatusBadRequest, "%s", "fail") return } c.String(http.StatusOK, "%s", "success") + return } From daf5e2134fd17a3edf010b1e09bfce679c5ead72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 14:07:56 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=98=BF=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/third/paymentService/ali_service.go | 24 +++++----- app/third/paymentService/payment_test.go | 57 +++++++++++++++++++++--- 2 files changed, 64 insertions(+), 17 deletions(-) diff --git a/app/third/paymentService/ali_service.go b/app/third/paymentService/ali_service.go index df76b20..1148d7b 100644 --- a/app/third/paymentService/ali_service.go +++ b/app/third/paymentService/ali_service.go @@ -149,8 +149,8 @@ func ALiOrderQuery(ctx context.Context, aliConfig AliPay, OrderNo string) (PayOr tradeStateDesc = "未付款交易超时关闭,或支付完成后全额退款" } - amountTotal, _ := strconv.Atoi(aliRsp.Response.TotalAmount) - payerTotal, _ := strconv.Atoi(aliRsp.Response.BuyerPayAmount) + amountTotal, _ := strconv.ParseFloat(aliRsp.Response.TotalAmount, 64) + payerTotal, _ := strconv.ParseFloat(aliRsp.Response.BuyerPayAmount, 64) // 构建数据 outTradeNo, _ := strconv.Atoi(aliRsp.Response.OutTradeNo) return PayOrderQueryInfo{ @@ -177,9 +177,10 @@ func AliRefundOrder(ctx context.Context, orderRefundRequest OrderRefundRequest) return OrderRefundInfo{}, err } // 请求参数 + refundAmount := float64(orderRefundRequest.RefundAmount) / 100.0 bm := make(gopay.BodyMap) bm.Set("out_trade_no", orderRefundRequest.OrderId). - Set("refund_amount", orderRefundRequest.RefundAmount). + Set("refund_amount", refundAmount). Set("refund_reason", orderRefundRequest.RefundReason). Set("out_request_no", orderRefundRequest.RefundOrderId) @@ -193,14 +194,15 @@ func AliRefundOrder(ctx context.Context, orderRefundRequest OrderRefundRequest) return OrderRefundInfo{}, err } - refundFee, _ := strconv.Atoi(aliRsp.Response.RefundFee) - outTradeNo, _ := strconv.Atoi(aliRsp.Response.OutTradeNo) + refundFee, _ := strconv.ParseFloat(aliRsp.Response.RefundFee, 64) + outTradeNo, _ := strconv.ParseFloat(aliRsp.Response.OutTradeNo, 64) return OrderRefundInfo{ - OutTradeNo: int64(outTradeNo), - TransactionId: aliRsp.Response.TradeNo, - RefundFee: int64(refundFee * 100), - RefundOrderId: orderRefundRequest.RefundOrderId, - RefundStatus: payCommon.PAY_REFUND_STATU_SUCCESS, + OutTradeNo: int64(outTradeNo), + TransactionId: aliRsp.Response.TradeNo, + RefundFee: int64(refundFee * 100), + RefundOrderId: orderRefundRequest.RefundOrderId, + RefundStatus: payCommon.PAY_REFUND_STATU_SUCCESS, + RefundSuccessTime: aliRsp.Response.GmtRefundPay, }, nil } @@ -230,7 +232,7 @@ func AliRefundOrderQuery(ctx context.Context, orderRefundQueryRequest OrderRefun } return OrderRefundInfo{}, err } - refundFee, _ := strconv.Atoi(aliRsp.Response.RefundAmount) + refundFee, _ := strconv.ParseFloat(aliRsp.Response.RefundAmount, 64) outTradeNo, _ := strconv.Atoi(aliRsp.Response.OutTradeNo) refundOrderId, _ := strconv.Atoi(aliRsp.Response.OutRequestNo) return OrderRefundInfo{ diff --git a/app/third/paymentService/payment_test.go b/app/third/paymentService/payment_test.go index 07dab2b..caed5b0 100644 --- a/app/third/paymentService/payment_test.go +++ b/app/third/paymentService/payment_test.go @@ -32,12 +32,57 @@ func TestMarketSendRequest_Market(t *testing.T) { return } - request := PayOrderRequest{ + //request := PayOrderRequest{ + // OrderId: 12312312312, + // PayChannelId: 8935141660703064070, + // ChannelType: 6, + // Description: "测试商品", + // Amount: 1, + // PayerClientIp: "192.168.110.235", + // Ali: AliPay{ + // AppId: "9021000139661858", + // PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7ZcaNtdJcUItQln1xfjKBQHfl2TPnvyVpOP96QsJQCOga5ThI9Nuv6R7nVsO+4HvbJ4m8fuRQboBwhf88pqfDMbvjd6WW7ZcqO7GoFODmbIsGZrakMMJ5taMY+gYZhPGlZSMUFq7NzGIcw4rdpRE4j24nUwbkIC6S5pcbLPz1j6gbp4u9FYXPNhq09P9m8ho/UctKPYA/Awx3sh4STTCUFND0hSBRS88IF7Ta5IEk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lT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), + // }, + //} + //PaymentService(c, request) + + //request := PayOrderQueryRequest{ + // OrderId: 12312312312, + // PayChannel: 2, + // Ali: AliPay{ + // AppId: "9021000139661858", + // PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7ZcaNtdJcUItQln1xfjKBQHfl2TPnvyVpOP96QsJQCOga5ThI9Nuv6R7nVsO+4HvbJ4m8fuRQboBwhf88pqfDMbvjd6WW7ZcqO7GoFODmbIsGZrakMMJ5taMY+gYZhPGlZSMUFq7NzGIcw4rdpRE4j24nUwbkIC6S5pcbLPz1j6gbp4u9FYXPNhq09P9m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SPLUqqTZAFZejOcmr07ln/pwZxluqplxC\n5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), + // }, + //} + //PayOrderQuery(c, request) + + //request := OrderRefundRequest{ + // OrderId: 12312312312, + // PayChannel: 2, + // RefundOrderId: 123133333333, + // RefundReason: "不合适", + // RefundAmount: 1, + // Ali: AliPay{ + // AppId: "9021000139661858", + // PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7ZcaNtdJcUItQln1xfjKBQHfl2TPnvyVpOP96QsJQCOga5ThI9Nuv6R7nVsO+4HvbJ4m8fuRQboBwhf88pqfDMbvjd6WW7ZcqO7GoF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JKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMh4FKYO\nZyRQHD6eFbPKZeSAnrfjfU7xmS9Yoozuu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC\n5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), + // }, + //} + + //OrderRefund(c, request) + + request := OrderRefundQueryRequest{ + RefundOrderId: 123133333333, OrderId: 12312312312, - ChannelType: 6, - Description: "测试商品", - Amount: 1, - PayerClientIp: "192.168.110.235", + PayChannel: 2, Ali: AliPay{ AppId: "9021000139661858", PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7Zca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JHUaOSXNFPAEy4IZscLUp+3ILSFw47+mxMKR0Ge2r+G0/mremFTve4pD6VuSQKBgAMdY5rZOD9fhndAsSqRRy530e46ibc1cM4wW2xewHVtySfCzI8eqT8U7ygKnqz9ngkp2RUBmfohEO4wg597uByDHUiGz9/7edRCUJrNvj8tWeTl+bVD99x7nQVNOCsPit0s8OS4CfAxeG10UcN4CwasDokoLgWW8jupyBeB/ptBAoGAf/YJGqYGUogmL1otFf82BwglNfXHjdiFwqC1BLwlIuyOQDQE8nMPF6yKDv6xXY1Zm+zH5RBrIOcLRdF08jSUCfPV2yn2U2tWsC2MSq4n+y4pxqwsQgUXfqrabX3Zf1EEFf329ZhZHwrhDW3PshjEYuz8Yei8gK+44KBk0ZKJCVA=", @@ -46,7 +91,7 @@ func TestMarketSendRequest_Market(t *testing.T) { AlipayPublicCert: []byte("-----BEGIN CERTIFICATE-----\nMIIDszCCApugAwIBAgIQICQIBZUM3AD4AzStxXRIiTANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE\nBhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv\nbiBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1\ndGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjQwODA1MDMxNzI5WhcNMjUwODA1MDMxNzI5WjCB\nhDELMAkGA1UEBhMCQ04xHzAdBgNVBAoMFnZ5ZWZ5bTgxMjNAc2FuZGJveC5jb20xDzANBgNVBAsM\nBkFsaXBheTFDMEEGA1UEAww65pSv5LuY5a6dKOS4reWbvSnnvZHnu5zmioDmnK/mnInpmZDlhazl\nj7gtMjA4ODcyMTA0MDQ2MDI0NjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKkLMWQI\nhNUJOcp2oy9LPdOorzSfwruFe09G84/wCdCBsNPBH0H/LFW6F0vbY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gwSQW50IEZpbmFuY2lhbCB0ZXN0MSUwIwYDVQQLDBxDZXJ0aWZpY2F0aW9uIEF1\ndGhvcml0eSB0ZXN0MT4wPAYDVQQDDDVBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y\naXR5IENsYXNzIDIgUjEgdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMh4FKYO\nZyRQHD6eFbPKZeSAnrfjfU7xmS9Yoozuu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC\n5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), }, } - PaymentService(c, request) + OrderRefundQuery(c, request) } func GetCertSN(certPathOrData any) (sn string, err error) { From d488dddefdd6bbe3d328ca492a7330d312bc353e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 14:32:50 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E6=94=AF=E4=BB=98=20=E5=B0=86=E8=AE=A2=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=E8=BD=AC=E5=8C=96=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/third/paymentService/payment_test.go | 72 +++++++++++++--------- app/third/paymentService/wechat_service.go | 8 +-- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/app/third/paymentService/payment_test.go b/app/third/paymentService/payment_test.go index caed5b0..e80175c 100644 --- a/app/third/paymentService/payment_test.go +++ b/app/third/paymentService/payment_test.go @@ -32,22 +32,29 @@ func TestMarketSendRequest_Market(t *testing.T) { return } - //request := PayOrderRequest{ - // OrderId: 12312312312, - // PayChannelId: 8935141660703064070, - // ChannelType: 6, - // Description: "测试商品", - // Amount: 1, - // PayerClientIp: "192.168.110.235", - // Ali: AliPay{ - // AppId: "9021000139661858", - // PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7ZcaNtdJcUItQln1xfjKBQHfl2TPnvyVpOP96QsJQCOga5ThI9Nuv6R7nVsO+4HvbJ4m8fuRQboBwhf88pqfDMbvjd6WW7ZcqO7GoFODmbIsGZrakMMJ5taMY+gYZhPGlZSMUFq7NzGIcw4rdpRE4j24nUwbkIC6S5pcbLPz1j6gbp4u9FYXPNhq09P9m8ho/UctKPYA/Awx3sh4STTCUFND0hSBRS88IF7Ta5IEkMx8mpekh4mXH/DMNu6SnbuoV4wID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KNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), - // }, - //} - //PaymentService(c, request) + request := PayOrderRequest{ + OrderId: 12312312312, + PayChannelId: 8935141660703064070, + ChannelType: 2, + Description: "测试商品", + Amount: 1, + PayerClientIp: "192.168.110.235", + Ali: AliPay{ + AppId: "9021000139661858", + PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7ZcaNtdJcUItQln1xfjKBQHfl2TPnvyVpOP96QsJQCOga5ThI9Nuv6R7nVsO+4HvbJ4m8fuRQboBwhf88pqfDMbvjd6WW7ZcqO7GoFODmbIsGZrakMMJ5taMY+gYZhPGlZSMUFq7NzGIcw4rdpRE4j24nUwbkIC6S5pcbLPz1j6g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uu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC\n5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), + }, + Wx: WxPay{ + AppId: "wx0a9d03516e77308c", + MchId: "1647084265", + SerialNo: "318457037183AFED5B9A55C129007D9EFE737B18", + ApiV3Key: "lsxdtvR2vOgGBu03u6wA0j9RnX5IP1Yq", + PrivateKey: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7TG44IkSH7c/c\nFJ0+dTvcA9uYPdyIRFGRmtRBVEMP0S9q9MoVAuEeQ0/yxLmTmKb7/kAwShqNbwDU\niIm0y9b1jMpl1NM3lvEG5+LL1xMYKIRh2iOInoZSYpX46l5ME7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eBm16sanMmGlTcz9SkIB/n11Wnii1ue5JCBiKXhj5SmOPgBWKeNBAoGARVZ2\nfwND7KmTAmEZEQCZuNuk6xsm16OAA4D+b9hrV4MEcgybvfZobLzRiXdFiOxS3xCG\n7OeQMULRrIZ1aCL9GaxPQ4RSM4Z77Hnm06tq8N4n8yuFop1J/sN8cB1Si/JkrG3X\n79OZFY16D18Rda7yWKOxQ7n6lCrStRDA0GNmjkUCgYEAnCd1PVJJ+VX7CXJ6gz7H\n0VXLAD+GUQzlnSzv6mgGWzn0acpVz9Q+o1qpxgNL/ehLTz+v3Nr7hexl77pUDVfJ\nS1zBopXaKx330eAJm4d0bKgKndHyfr7VJ6f5H/WezX7Q5jkm32D9/GPhJCfqBp3q\nWA/g+9g+fwkc78QKuQl7M68=\n-----END PRIVATE KEY-----\n", + }, + } + PaymentService(c, request) //request := PayOrderQueryRequest{ // OrderId: 12312312312, @@ -79,19 +86,26 @@ func TestMarketSendRequest_Market(t *testing.T) { //OrderRefund(c, request) - request := OrderRefundQueryRequest{ - RefundOrderId: 123133333333, - OrderId: 12312312312, - PayChannel: 2, - Ali: AliPay{ - AppId: "9021000139661858", - PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7ZcaNtdJcUItQln1xfjKBQHfl2TPnvyVpOP96QsJQCOga5ThI9Nuv6R7nVsO+4HvbJ4m8fuRQboBwhf88pqfDMbvjd6WW7ZcqO7GoFODmbIsGZrakMMJ5taMY+gYZhPGlZSMUFq7NzGIcw4rdpRE4j24nUwbkIC6S5pcbLPz1j6gbp4u9FYXPNhq09P9m8ho/UctKPYA/Awx3sh4STTCUFND0hSBRS88IF7Ta5IEkMx8mpekh4mXH/DMNu6SnbuoV4wIDAQABAoIBAG8aAHT8HtLhS13f1rA0HLJ4NDFoWrd+aNnAnLUwyHXPKixQ8uLQk3cKgmpWkgB4Q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ROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), - }, - } - OrderRefundQuery(c, request) + //request := OrderRefundQueryRequest{ + // RefundOrderId: 123133333333, + // OrderId: 12312312312, + // PayChannel: 2, + // Ali: AliPay{ + // AppId: "9021000139661858", + // PrivateKey: "MIIEogIBAAKCAQEAiJ6MGX+/0oDMbVcFOew70ukNft55HvBmfD2+oBMMZ7ZfvPXGTQYtsA/0Q8BY9CMQh/Oa42jXiM7Upn3STMD7ZcaNtdJcUItQln1xfjKBQHfl2TPnvyVpOP96QsJQCOga5ThI9Nuv6R7nVsO+4HvbJ4m8fuRQboBwhf88pqfDMbvjd6WW7ZcqO7GoFODmbIsGZrakMMJ5taMY+gYZhPGlZSMUFq7NzGIcw4rdpRE4j24nUwbkIC6S5pcbLPz1j6gbp4u9FYXPNhq09P9m8ho/UctKPYA/Awx3sh4STTCUFND0hSBRS88IF7Ta5IEkMx8mpekh4mXH/DMNu6SnbuoV4wIDAQABAoIBAG8aAHT8HtL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Zj6vUTMb705gYgm\nVUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi\nt25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG\nwpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3\nDQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT\nyWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf\nLTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p\nj1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy\n1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW\n-----END CERTIFICATE-----\n"), + // }, + // Wx: WxPay{ + // AppId: "wx0a9d03516e77308c", + // MchId: "1647084265", + // SerialNo: "318457037183AFED5B9A55C129007D9EFE737B18", + // ApiV3Key: "lsxdtvR2vOgGBu03u6wA0j9RnX5IP1Yq", + // PrivateKey: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7TG44IkSH7c/c\nFJ0+dTvcA9uYPdyIRFGRmtRBVEMP0S9q9MoVAuEeQ0/yxLmTmKb7/kAwShqNbwDU\niIm0y9b1jMpl1NM3lvEG5+LL1xMYKIRh2iOInoZSYpX46l5ME7FQwUq4GyoTg+5o\naIUKHXtzldzUR8/MXnpljYKL1oKb04vA627EMiUNm+Hajt4elhm3UXmOva1ohir7\nb69NEeleM4wjCxG+7ueuF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rV4MEcgybvfZobLzRiXdFiOxS3xCG\n7OeQMULRrIZ1aCL9GaxPQ4RSM4Z77Hnm06tq8N4n8yuFop1J/sN8cB1Si/JkrG3X\n79OZFY16D18Rda7yWKOxQ7n6lCrStRDA0GNmjkUCgYEAnCd1PVJJ+VX7CXJ6gz7H\n0VXLAD+GUQzlnSzv6mgGWzn0acpVz9Q+o1qpxgNL/ehLTz+v3Nr7hexl77pUDVfJ\nS1zBopXaKx330eAJm4d0bKgKndHyfr7VJ6f5H/WezX7Q5jkm32D9/GPhJCfqBp3q\nWA/g+9g+fwkc78QKuQl7M68=\n-----END PRIVATE KEY-----\n", + // }, + //} + //OrderRefundQuery(c, request) } func GetCertSN(certPathOrData any) (sn string, err error) { diff --git a/app/third/paymentService/wechat_service.go b/app/third/paymentService/wechat_service.go index da0eb77..65c11e6 100644 --- a/app/third/paymentService/wechat_service.go +++ b/app/third/paymentService/wechat_service.go @@ -73,7 +73,7 @@ func WxH5PayInfo(c context.Context, payOrderRequest PayOrderRequest) (string, er bm.Set("appid", payOrderRequest.Wx.AppId). Set("mchid", payOrderRequest.Wx.MchId). Set("description", payOrderRequest.Description). - Set("out_trade_no", payOrderRequest.OrderId). + Set("out_trade_no", strconv.FormatInt(payOrderRequest.OrderId, 10)). Set("time_expire", expire). Set("notify_url", fmt.Sprintf(envConfig.PayService.Host+payCommon.WX_NOTIFY_URL_TEST+"%d", payOrderRequest.PayChannelId)). SetBodyMap("amount", func(bm gopay.BodyMap) { @@ -199,10 +199,10 @@ func WxOrderRefund(ctx context.Context, orderRefundRequest OrderRefundRequest) ( } // 初始化 BodyMap bm := make(gopay.BodyMap) - bm.Set("out_trade_no", orderRefundRequest.OrderId). + bm.Set("out_trade_no", strconv.FormatInt(orderRefundRequest.OrderId, 10)). Set("sign_type", "MD5"). // 必填 退款订单号(程序员定义的) - Set("out_refund_no", orderRefundRequest.RefundOrderId). + Set("out_refund_no", strconv.FormatInt(orderRefundRequest.RefundOrderId, 10)). // 选填 退款描述 Set("reason", orderRefundRequest.RefundReason). SetBodyMap("amount", func(bm gopay.BodyMap) { @@ -298,7 +298,7 @@ func WxCloseOrder(ctx context.Context, orderCloseRequest OrderCloseRequest) (Ord if err != nil { return OrderCloseInfo{}, err } - wxRsp, err := wxClient.V3TransactionCloseOrder(ctx, "FY160932049419637602") + wxRsp, err := wxClient.V3TransactionCloseOrder(ctx, strconv.FormatInt(orderCloseRequest.OrderId, 10)) if err != nil { return OrderCloseInfo{}, err } From 7ee666e459fa60624123042f95569334e0ee842f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 15:11:51 +0800 Subject: [PATCH 10/12] =?UTF-8?q?order=5Fthird=5Fpay=5Flog=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=95=B0=E6=8D=AE=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/orderthirdpaylogmodel/order_third_pay_log.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/orderthirdpaylogmodel/order_third_pay_log.go b/app/models/orderthirdpaylogmodel/order_third_pay_log.go index 4ef23b6..c36da2e 100644 --- a/app/models/orderthirdpaylogmodel/order_third_pay_log.go +++ b/app/models/orderthirdpaylogmodel/order_third_pay_log.go @@ -15,10 +15,11 @@ var ( type OrderThirdPayLog struct { Id int64 OrderId int64 `xorm:"'order_id' bigint(20)"` - PayCallback string `xorm:"'pay_callback' varchar(255)"` + PayCallback string `xorm:"'pay_callback' JSON"` Status int `xorm:"'status' TINYINT"` - MerchantParam string `xorm:"'merchant_param' varchar(255)"` - MerchantCallback string `xorm:"'merchant_callback' varchar(255)"` + PayParam string `xorm:"'pay_param' JSON"` + MerchantCallback string `xorm:"'merchant_callback' JSON"` + Type int `xorm:"'type' TINYINT"` CreateTime time.Time `xorm:"'create_time' datetime created"` } From 3ed083bff66f71147d848f39008cdaba7696185d Mon Sep 17 00:00:00 2001 From: wolter Date: Tue, 6 Aug 2024 15:12:05 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=9A=E7=94=A8=E6=88=B7=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/http/entities/backend/order.go | 2 ++ app/models/ordersmodel/orders.go | 1 + 2 files changed, 3 insertions(+) diff --git a/app/http/entities/backend/order.go b/app/http/entities/backend/order.go index ae5d5fa..601622b 100644 --- a/app/http/entities/backend/order.go +++ b/app/http/entities/backend/order.go @@ -73,6 +73,7 @@ type OrdersResponse struct { Status int `json:"status"` OrderType int `json:"order_type"` Amount int `json:"amount"` + PayerTotal int `json:"payer_total"` ExtJson string `json:"ext_json"` CreateTime string `json:"create_time"` UpdateTime string `json:"update_time"` @@ -90,6 +91,7 @@ func (o *OrdersResponse) ResponseFromDb(db ordersmodel.OrdersBackendList) { o.Status = db.Status o.OrderType = db.OrderType o.Amount = db.Amount + o.PayerTotal = db.PayerTotal o.ExtJson = db.ExtJson o.CreateTime = db.CreateTime.Format("2006-01-02 15:04:05") o.UpdateTime = db.UpdateTime.Format("2006-01-02 15:04:05") diff --git a/app/models/ordersmodel/orders.go b/app/models/ordersmodel/orders.go index 798bddf..85cb91a 100644 --- a/app/models/ordersmodel/orders.go +++ b/app/models/ordersmodel/orders.go @@ -20,6 +20,7 @@ type Orders struct { OutTreadNo string `xorm:"'out_tread_no' varchar(50)"` OrderType int `xorm:"'order_type' TINYINT"` Amount int `xorm:"'amount' int(11)"` + PayerTotal int `xorm:"'payer_total' int(11)"` ExtJson string `xorm:"'ext_json' varchar(1024)"` CreateTime time.Time `xorm:"'create_time' datetime created"` UpdateTime time.Time `xorm:"'update_time' timestamp updated"` From 2927161585c3e0e1b45157c412b78ac404e21637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 6 Aug 2024 15:41:57 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/console/command.go | 2 +- app/constants/common/common.go | 7 ++ app/third/paymentService/payment_service.go | 86 +++++++++++++++++++-- 3 files changed, 88 insertions(+), 7 deletions(-) diff --git a/app/console/command.go b/app/console/command.go index 0573b93..02d5793 100644 --- a/app/console/command.go +++ b/app/console/command.go @@ -215,7 +215,7 @@ func queryOrder() { OrderId: orderInfo.Id, PayCallback: string(body), Status: 0, - MerchantParam: "", + PayParam: "", MerchantCallback: "", } _, err = orderLogRepo.OrderThirdPayLogInsertOne(&log) diff --git a/app/constants/common/common.go b/app/constants/common/common.go index 7c2c42a..dee65f3 100644 --- a/app/constants/common/common.go +++ b/app/constants/common/common.go @@ -31,4 +31,11 @@ const ( PAY_CHANNLE_TYPE_WECHAT = 1 // 支付类型: 微信 PAY_CHANNLE_TYPE_ZFB = 2 // 支付类型:支付宝 + + THIRD_ORDER_TYPE_PAY = 1 // 发起支付 + THIRD_ORDER_TYPE_ORDER_QUERY = 2 // 查询订单 + THIRD_ORDER_TYPE_REFUND = 3 // 发起退款 + THIRD_ORDER_TYPE_REFUND_QUERY = 4 // 退款查询 + THIRD_ORDER_TYPE_CLOSE = 5 // 关闭订单 + THIRD_ORDER_TYPE_CALL_BACK = 6 // 支付回调 ) diff --git a/app/third/paymentService/payment_service.go b/app/third/paymentService/payment_service.go index 6f5e00b..63540f4 100644 --- a/app/third/paymentService/payment_service.go +++ b/app/third/paymentService/payment_service.go @@ -1,8 +1,13 @@ package paymentService import ( + "PaymentCenter/app/constants/common" + "PaymentCenter/app/data" + "PaymentCenter/app/models/orderthirdpaylogmodel" + "PaymentCenter/app/models/paychannelmodel" "PaymentCenter/app/third/paymentService/payCommon" "context" + "encoding/json" "github.com/qit-team/snow-core/log/logger" "strconv" ) @@ -41,7 +46,7 @@ type PayOrderResponse struct { } // PaymentService 统一发起支付 -func PaymentService(c context.Context, payOrderRequest PayOrderRequest) (payOrderResponse PayOrderResponse) { +func PaymentService(c context.Context, payOrderRequest PayOrderRequest) PayOrderResponse { logger.Info(c, "PaymentService 收到支付请求", payOrderRequest) var err error var info string @@ -64,11 +69,20 @@ func PaymentService(c context.Context, payOrderRequest PayOrderRequest) (payOrde ErrorMsg: err.Error(), } } - return PayOrderResponse{ + payOrderResponse := PayOrderResponse{ Code: payCommon.PAY_SUCCESS_CODE, ErrorMsg: "", Result: info, } + // 记录日志 + go func() { + orderId := payOrderRequest.OrderId + payCallback := info + payParam, _ := json.Marshal(payOrderRequest) + merchantCallback, _ := json.Marshal(payOrderResponse) + saveLog(orderId, common.THIRD_ORDER_TYPE_PAY, payCallback, string(payParam), string(merchantCallback)) + }() + return payOrderResponse } type PayOrderQueryRequest struct { @@ -117,10 +131,21 @@ func PayOrderQuery(c context.Context, payOrderQueryRequest PayOrderQueryRequest) ErrorMsg: err.Error(), } } - return PayOrderQueryResponse{ + + payOrderQueryResponse := PayOrderQueryResponse{ Code: payCommon.PAY_SUCCESS_CODE, Result: info, } + + // 记录日志 + go func() { + orderId := payOrderQueryRequest.OrderId + payCallback, _ := json.Marshal(info) + payParam, _ := json.Marshal(payOrderQueryRequest) + merchantCallback, _ := json.Marshal(payOrderQueryResponse) + saveLog(orderId, common.THIRD_ORDER_TYPE_ORDER_QUERY, string(payCallback), string(payParam), string(merchantCallback)) + }() + return payOrderQueryResponse } type OrderRefundRequest struct { @@ -171,10 +196,21 @@ func OrderRefund(c context.Context, orderRefundRequest OrderRefundRequest) Order ErrorMsg: err.Error(), } } - return OrderRefundResponse{ + + orderRefundResponse := OrderRefundResponse{ Code: payCommon.PAY_SUCCESS_CODE, Result: info, } + // 记录日志 + go func() { + orderId := orderRefundRequest.OrderId + payCallback, _ := json.Marshal(info) + payParam, _ := json.Marshal(orderRefundRequest) + merchantCallback, _ := json.Marshal(orderRefundResponse) + saveLog(orderId, common.THIRD_ORDER_TYPE_REFUND, string(payCallback), string(payParam), string(merchantCallback)) + }() + + return orderRefundResponse } type OrderRefundQueryRequest struct { @@ -212,10 +248,21 @@ func OrderRefundQuery(c context.Context, orderRefundQueryRequest OrderRefundQuer ErrorMsg: err.Error(), } } - return OrderRefundQueryResponse{ + orderRefundQueryResponse := OrderRefundQueryResponse{ Code: payCommon.PAY_SUCCESS_CODE, Result: info, } + + // 记录日志 + go func() { + orderId := orderRefundQueryRequest.OrderId + payCallback, _ := json.Marshal(info) + payParam, _ := json.Marshal(orderRefundQueryRequest) + merchantCallback, _ := json.Marshal(orderRefundQueryResponse) + saveLog(orderId, common.THIRD_ORDER_TYPE_REFUND_QUERY, string(payCallback), string(payParam), string(merchantCallback)) + }() + + return orderRefundQueryResponse } type OrderCloseRequest struct { @@ -258,8 +305,35 @@ func OrderClose(c context.Context, orderCloseRequest OrderCloseRequest) OrderClo ErrorMsg: err.Error(), } } - return OrderCloseResponse{ + orderCloseResponse := OrderCloseResponse{ Code: payCommon.PAY_SUCCESS_CODE, Result: info, } + // 记录日志 + go func() { + orderId := orderCloseRequest.OrderId + payCallback, _ := json.Marshal(info) + payParam, _ := json.Marshal(orderCloseRequest) + merchantCallback, _ := json.Marshal(orderCloseResponse) + saveLog(orderId, common.THIRD_ORDER_TYPE_CLOSE, string(payCallback), string(payParam), string(merchantCallback)) + }() + + return orderCloseResponse +} + +// saveLog 记录操作日志 +func saveLog(orderId int64, OType int, payCallback string, PayParam string, MerchantCallback string) { + thirdRepo := data.NewOrderThirdPayLogRepo(paychannelmodel.GetInstance().GetDb()) + log := orderthirdpaylogmodel.OrderThirdPayLog{ + OrderId: orderId, + PayCallback: payCallback, + Status: 0, + PayParam: PayParam, + MerchantCallback: MerchantCallback, + Type: OType, + } + _, err := thirdRepo.OrderThirdPayLogInsertOne(&log) + if err != nil { + return + } }