|
@@ -36,6 +36,7 @@ var (
|
|
|
func UnifiedOrder(c *gin.Context) {
|
|
|
var inData models.UnifiedOrderRequest
|
|
|
var sqlData shanghu.ClientPayTrans
|
|
|
+ var outData models.UnifiedOrderReply
|
|
|
|
|
|
err := c.ShouldBindJSON(&inData)
|
|
|
if err != nil {
|
|
@@ -105,12 +106,22 @@ func UnifiedOrder(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ timestamp := strconv.FormatInt(time.Now().Unix(), 10)
|
|
|
+ pac := "prepay_id=" + wxResp.PrepayId
|
|
|
+ paySign := wechat.GetMiniPaySign("wx25357518f710b8ce", wxResp.NonceStr, pac, wechat.SignType_MD5, timestamp, "1RKRJBVH4vaRrF0XPW9GX2M3ZSImukIz")
|
|
|
+
|
|
|
+ outData.Timestamp = timestamp
|
|
|
+ outData.NonceStr = wxResp.NonceStr
|
|
|
+ outData.Package = pac
|
|
|
+ outData.PaySign = paySign
|
|
|
+ outData.SignType = wechat.SignType_MD5
|
|
|
+
|
|
|
//merchant, count, err := sqlData.GetOpenIdList(pageSize, pageIndex)
|
|
|
//if err != nil {
|
|
|
// app.Error(c, 500, err, err.Error())
|
|
|
// return
|
|
|
//}
|
|
|
- app.OK(c, wxResp, app.Success)
|
|
|
+ app.OK(c, outData, app.Success)
|
|
|
|
|
|
}
|
|
|
|