fix: 富友验签失败 — 补全3.3接口所有非reserved字段(空值字段也必须参与签名)
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m7s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m7s
This commit is contained in:
@@ -4,7 +4,8 @@ package fuiou
|
||||
|
||||
import "encoding/xml"
|
||||
|
||||
// WxPreCreateRequest wxPreCreate 下单请求
|
||||
// WxPreCreateRequest wxPreCreate 下单请求(3.3接口)
|
||||
// 所有非 reserved 字段必须出现在 XML 中(含空值),否则富友验签不通过
|
||||
type WxPreCreateRequest struct {
|
||||
XMLName xml.Name `xml:"xml"`
|
||||
Version string `xml:"version"` // 版本号: 1.0
|
||||
@@ -13,16 +14,22 @@ type WxPreCreateRequest struct {
|
||||
TermId string `xml:"term_id"` // 终端号
|
||||
RandomStr string `xml:"random_str"` // 随机字符串
|
||||
Sign string `xml:"sign"` // 签名
|
||||
MchntOrderNo string `xml:"mchnt_order_no"` // 商户订单号
|
||||
TradeType string `xml:"trade_type"` // 交易类型: JSAPI=公众号 LETPAY=小程序
|
||||
OrderAmt string `xml:"order_amt"` // 订单金额(分)
|
||||
GoodsDesc string `xml:"goods_des"` // 商品描述
|
||||
GoodsDetail string `xml:"goods_detail"` // 商品详情(可选)
|
||||
GoodsTag string `xml:"goods_tag"` // 商品标记(可选)
|
||||
ProductId string `xml:"product_id"` // 商品标识(可选)
|
||||
AddnInf string `xml:"addn_inf"` // 附加数据(可选)
|
||||
MchntOrderNo string `xml:"mchnt_order_no"` // 商户订单号
|
||||
CurrType string `xml:"curr_type"` // 货币类型(可选)
|
||||
OrderAmt string `xml:"order_amt"` // 订单金额(分)
|
||||
TermIp string `xml:"term_ip"` // 终端IP
|
||||
TxnBeginTs string `xml:"txn_begin_ts"` // 交易起始时间,格式 yyyyMMddHHmmss
|
||||
NotifyUrl string `xml:"notify_url"` // 回调地址
|
||||
SubAppid string `xml:"sub_appid"` // 子应用ID(公众号/小程序AppID)
|
||||
SubOpenid string `xml:"sub_openid"` // 用户OpenID
|
||||
LimitPay string `xml:"limit_pay"` // 限制支付方式(可选)
|
||||
TradeType string `xml:"trade_type"` // 交易类型: JSAPI=公众号 LETPAY=小程序
|
||||
Openid string `xml:"openid"` // 用户标识(已废弃,保留参与签名)
|
||||
SubOpenid string `xml:"sub_openid"` // 用户OpenID
|
||||
SubAppid string `xml:"sub_appid"` // 子应用ID(公众号/小程序AppID)
|
||||
}
|
||||
|
||||
// WxPreCreateResponse wxPreCreate 下单响应
|
||||
|
||||
Reference in New Issue
Block a user