|
@@ -54,7 +54,7 @@ func (w *WsDataExport) GetPayParm() error {
|
|
|
"user_id": userid,
|
|
|
"filter_id": filterid,
|
|
|
"id": id,
|
|
|
- }, "prepay_id,order_code,order_money,id,prepay_time,pay_way,out_trade_no", "")
|
|
|
+ }, "prepay_id,order_code,order_money,id,prepay_time,pay_way,out_trade_no,user_mail", "")
|
|
|
if Order == nil {
|
|
|
log.Println("查不到订单!")
|
|
|
w.ServeJson(map[string]interface{}{
|
|
@@ -71,13 +71,14 @@ func (w *WsDataExport) GetPayParm() error {
|
|
|
// return nil
|
|
|
// }
|
|
|
pay_way := util.ObjToString((*Order)["pay_way"])
|
|
|
- code := util.ObjToString((*Order)["order_code"])
|
|
|
+ order_code := util.ObjToString((*Order)["order_code"])
|
|
|
orderid := util.Int64All((*Order)["id"])
|
|
|
orderMoney := util.IntAll((*Order)["order_money"])
|
|
|
+ user_mail := util.ObjToString((*Order)["user_mail"])
|
|
|
|
|
|
- realToken := public.GetWaitPayToken(orderid, orderMoney, code, pay_way, userid)
|
|
|
+ realToken := public.GetWaitPayToken(orderid, orderMoney, order_code, pay_way, userid)
|
|
|
if realToken != token && pay_way == "wx_js" {
|
|
|
- log.Println("token错误!", userid, realToken, token, code, orderMoney, orderid, pay_way)
|
|
|
+ log.Println("token错误!", userid, realToken, token, order_code, orderMoney, orderid, pay_way)
|
|
|
return nil
|
|
|
}
|
|
|
prepayTime, err := time.ParseInLocation(util.Date_Full_Layout, util.ObjToString((*Order)["prepay_time"]), time.Local)
|
|
@@ -110,13 +111,15 @@ func (w *WsDataExport) GetPayParm() error {
|
|
|
nonceStr := util.GetRandom(16) + util.GetLetterRandom(16)
|
|
|
sign := util.WxSign(fmt.Sprintf("appId=%s&nonceStr=%s&package=%s&signType=%s&timeStamp=%d&key=%s", public.WxStruct.Appid, nonceStr, "prepay_id="+prepayId, "MD5", timestamp, public.WxStruct.Key))
|
|
|
w.ServeJson(map[string]interface{}{
|
|
|
- "status": 1,
|
|
|
- "appId": public.WxStruct.Appid,
|
|
|
- "timestamp": fmt.Sprint(timestamp),
|
|
|
- "signType": "MD5",
|
|
|
- "sign": sign,
|
|
|
- "nonceStr": nonceStr,
|
|
|
- "prepayId": "prepay_id=" + prepayId,
|
|
|
+ "status": 1,
|
|
|
+ "appId": public.WxStruct.Appid,
|
|
|
+ "timestamp": fmt.Sprint(timestamp),
|
|
|
+ "signType": "MD5",
|
|
|
+ "sign": sign,
|
|
|
+ "nonceStr": nonceStr,
|
|
|
+ "prepayId": "prepay_id=" + prepayId,
|
|
|
+ "order_code": order_code,
|
|
|
+ "user_mail": user_mail,
|
|
|
})
|
|
|
return nil
|
|
|
}
|