|
|
@@ -27,6 +27,8 @@ type DataParam struct { |
|
|
|
ReqTime string `json:"reqTime" explain:"请求时间戳(yyyyMMddHHmmss)"` |
|
|
|
MsgId string `json:"msgId" explain:"请求消息唯一编号"` |
|
|
|
Attach string `json:"attach" explain:"附加数据(附加数据,用于在同步应答或异步通知时原样返回)"` |
|
|
|
CertId string `json:"certId" explain:"数字证书 ID(默认 01)"` |
|
|
|
Version string `json:"version" explain:"版本号(默认 1.0.0)"` |
|
|
|
} `json:"head"` |
|
|
|
ReqBody map[string]string `json:"reqBody"` |
|
|
|
} |
|
|
@@ -41,6 +43,11 @@ func (payParam *PayParam) SetData(dataParam DataParam) *signParam { |
|
|
|
randomInt := rand.Intn(100) |
|
|
|
dataParam.Head.MsgId = zhios_pay_utils.AnyToString(randomInt) + dataParam.Head.MchtNo + now.Format("20060102150405") |
|
|
|
dataParam.Head.ReqTime = now.Format("20060102150405") |
|
|
|
dataParam.Head.CertId = "01" |
|
|
|
dataParam.Head.Version = "1.0.0" |
|
|
|
if dataParam.ReqBody["mchtOrderId"] != "" { |
|
|
|
dataParam.Head.MsgId = dataParam.ReqBody["mchtOrderId"] + now.Format("20060102150405") |
|
|
|
} |
|
|
|
payParam.Data = zhios_pay_utils.SerializeStr(dataParam) |
|
|
|
var signs signParam |
|
|
|
signs.PayParam = payParam |
|
|
|