记录third表
This commit is contained in:
parent
c9c7bdbc16
commit
222522dc76
|
@ -131,8 +131,8 @@ func ALiCallBack(notifyReq gopay.BodyMap, aliConfig AliPay) error {
|
||||||
// 记录日志
|
// 记录日志
|
||||||
go func() {
|
go func() {
|
||||||
payCallback, _ := json.Marshal(notifyReq)
|
payCallback, _ := json.Marshal(notifyReq)
|
||||||
payParam := ""
|
payParam := "{}"
|
||||||
saveLog(int64(orderId), common.THIRD_ORDER_TYPE_CALL_BACK, string(payCallback), payParam, string(merchantCallback))
|
SaveLog(int64(orderId), common.THIRD_ORDER_TYPE_CALL_BACK, string(payCallback), payParam, string(merchantCallback))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if res.ErrCode != errorcode.Success {
|
if res.ErrCode != errorcode.Success {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"PaymentCenter/app/third/paymentService/payCommon"
|
"PaymentCenter/app/third/paymentService/payCommon"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"github.com/qit-team/snow-core/log/logger"
|
"github.com/qit-team/snow-core/log/logger"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
@ -85,10 +86,10 @@ func PaymentService(c context.Context, payOrderRequest PayOrderRequest) PayOrder
|
||||||
// 记录日志
|
// 记录日志
|
||||||
go func() {
|
go func() {
|
||||||
orderId := payOrderRequest.OrderId
|
orderId := payOrderRequest.OrderId
|
||||||
payCallback := info
|
payCallback := fmt.Sprintf("{%s}", info)
|
||||||
payParam, _ := json.Marshal(payOrderRequest)
|
payParam, _ := json.Marshal(payOrderRequest)
|
||||||
merchantCallback, _ := json.Marshal(payOrderResponse)
|
merchantCallback, _ := json.Marshal(payOrderResponse)
|
||||||
saveLog(orderId, common.THIRD_ORDER_TYPE_PAY, payCallback, string(payParam), string(merchantCallback))
|
SaveLog(orderId, common.THIRD_ORDER_TYPE_PAY, payCallback, string(payParam), string(merchantCallback))
|
||||||
}()
|
}()
|
||||||
return payOrderResponse
|
return payOrderResponse
|
||||||
}
|
}
|
||||||
|
@ -151,7 +152,7 @@ func PayOrderQuery(c context.Context, payOrderQueryRequest PayOrderQueryRequest)
|
||||||
payCallback, _ := json.Marshal(info)
|
payCallback, _ := json.Marshal(info)
|
||||||
payParam, _ := json.Marshal(payOrderQueryRequest)
|
payParam, _ := json.Marshal(payOrderQueryRequest)
|
||||||
merchantCallback, _ := json.Marshal(payOrderQueryResponse)
|
merchantCallback, _ := json.Marshal(payOrderQueryResponse)
|
||||||
saveLog(orderId, common.THIRD_ORDER_TYPE_ORDER_QUERY, string(payCallback), string(payParam), string(merchantCallback))
|
SaveLog(orderId, common.THIRD_ORDER_TYPE_ORDER_QUERY, string(payCallback), string(payParam), string(merchantCallback))
|
||||||
}()
|
}()
|
||||||
return payOrderQueryResponse
|
return payOrderQueryResponse
|
||||||
}
|
}
|
||||||
|
@ -215,7 +216,7 @@ func OrderRefund(c context.Context, orderRefundRequest OrderRefundRequest) Order
|
||||||
payCallback, _ := json.Marshal(info)
|
payCallback, _ := json.Marshal(info)
|
||||||
payParam, _ := json.Marshal(orderRefundRequest)
|
payParam, _ := json.Marshal(orderRefundRequest)
|
||||||
merchantCallback, _ := json.Marshal(orderRefundResponse)
|
merchantCallback, _ := json.Marshal(orderRefundResponse)
|
||||||
saveLog(orderId, common.THIRD_ORDER_TYPE_REFUND, string(payCallback), string(payParam), string(merchantCallback))
|
SaveLog(orderId, common.THIRD_ORDER_TYPE_REFUND, string(payCallback), string(payParam), string(merchantCallback))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return orderRefundResponse
|
return orderRefundResponse
|
||||||
|
@ -267,7 +268,7 @@ func OrderRefundQuery(c context.Context, orderRefundQueryRequest OrderRefundQuer
|
||||||
payCallback, _ := json.Marshal(info)
|
payCallback, _ := json.Marshal(info)
|
||||||
payParam, _ := json.Marshal(orderRefundQueryRequest)
|
payParam, _ := json.Marshal(orderRefundQueryRequest)
|
||||||
merchantCallback, _ := json.Marshal(orderRefundQueryResponse)
|
merchantCallback, _ := json.Marshal(orderRefundQueryResponse)
|
||||||
saveLog(orderId, common.THIRD_ORDER_TYPE_REFUND_QUERY, string(payCallback), string(payParam), string(merchantCallback))
|
SaveLog(orderId, common.THIRD_ORDER_TYPE_REFUND_QUERY, string(payCallback), string(payParam), string(merchantCallback))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return orderRefundQueryResponse
|
return orderRefundQueryResponse
|
||||||
|
@ -323,14 +324,14 @@ func OrderClose(c context.Context, orderCloseRequest OrderCloseRequest) OrderClo
|
||||||
payCallback, _ := json.Marshal(info)
|
payCallback, _ := json.Marshal(info)
|
||||||
payParam, _ := json.Marshal(orderCloseRequest)
|
payParam, _ := json.Marshal(orderCloseRequest)
|
||||||
merchantCallback, _ := json.Marshal(orderCloseResponse)
|
merchantCallback, _ := json.Marshal(orderCloseResponse)
|
||||||
saveLog(orderId, common.THIRD_ORDER_TYPE_CLOSE, string(payCallback), string(payParam), string(merchantCallback))
|
SaveLog(orderId, common.THIRD_ORDER_TYPE_CLOSE, string(payCallback), string(payParam), string(merchantCallback))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return orderCloseResponse
|
return orderCloseResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
// saveLog 记录操作日志
|
// SaveLog 记录操作日志
|
||||||
func saveLog(orderId int64, OType int, payCallback string, PayParam string, MerchantCallback string) {
|
func SaveLog(orderId int64, OType int, payCallback string, PayParam string, MerchantCallback string) {
|
||||||
thirdRepo := data.NewOrderThirdPayLogRepo(paychannelmodel.GetInstance().GetDb())
|
thirdRepo := data.NewOrderThirdPayLogRepo(paychannelmodel.GetInstance().GetDb())
|
||||||
log := orderthirdpaylogmodel.OrderThirdPayLog{
|
log := orderthirdpaylogmodel.OrderThirdPayLog{
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
|
|
|
@ -165,8 +165,8 @@ func WxPayCallBack(notifyReq *wechat.V3NotifyReq, wxConfig WxPay) error {
|
||||||
// 记录日志
|
// 记录日志
|
||||||
go func() {
|
go func() {
|
||||||
payCallback, _ := json.Marshal(CallBackInfo)
|
payCallback, _ := json.Marshal(CallBackInfo)
|
||||||
payParam := ""
|
payParam := "{}"
|
||||||
saveLog(int64(orderId), common.THIRD_ORDER_TYPE_CALL_BACK, string(payCallback), payParam, string(merchantCallback))
|
SaveLog(int64(orderId), common.THIRD_ORDER_TYPE_CALL_BACK, string(payCallback), payParam, string(merchantCallback))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if res.ErrCode != errorcode.Success {
|
if res.ErrCode != errorcode.Success {
|
||||||
|
|
Loading…
Reference in New Issue