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