订单增加字段

This commit is contained in:
wuchao 2024-06-28 09:27:17 +08:00
parent b447a78441
commit 5ee88c0261
1 changed files with 2 additions and 2 deletions

View File

@ -172,14 +172,14 @@ func OrderRefundService(userId int, orderId int) (code int) {
func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderNotifyResponse) { func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderNotifyResponse) {
requestStr, _ := json.Marshal(request) requestStr, _ := json.Marshal(request)
utils.Log(nil, "OrderNotify", string(requestStr)) utils.Log(nil, "订单回调请求--原始数据:", string(requestStr))
response := youchu.DecryptResponse(string(requestStr), false) response := youchu.DecryptResponse(string(requestStr), false)
utils.Log(nil, "订单回调请求--解密数据:", response)
var YouChuOrderNotifyRequest front.YouChuOrderNotifyRequest var YouChuOrderNotifyRequest front.YouChuOrderNotifyRequest
err := json.Unmarshal([]byte(response), &YouChuOrderNotifyRequest) err := json.Unmarshal([]byte(response), &YouChuOrderNotifyRequest)
if err != nil { if err != nil {
return front.YouChuOrderNotifyResponse{RespCode: "000001", RespMsg: "解析失败"} return front.YouChuOrderNotifyResponse{RespCode: "000001", RespMsg: "解析失败"}
} }
utils.Log(nil, "YouChuOrderNotifyRequest", YouChuOrderNotifyRequest)
// 03-支付成功 04-支付失败 05-检查失败 // 03-支付成功 04-支付失败 05-检查失败
if YouChuOrderNotifyRequest.OrderSta != "03" { if YouChuOrderNotifyRequest.OrderSta != "03" {
return front.YouChuOrderNotifyResponse{RespCode: "000002", RespMsg: "交易失败"} return front.YouChuOrderNotifyResponse{RespCode: "000002", RespMsg: "交易失败"}