1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 12:52:27 +08:00

支付 新增 BridgeConfig 方法,可获得 prepay ID,及js支付时所需要的参数

统一下单 新增非必传参数
This commit is contained in:
ciel yu
2019-10-14 18:59:42 +08:00
parent abd7f512ba
commit 546dce2396

View File

@@ -35,6 +35,10 @@ type Params struct {
OpenID string
TradeType string
SignType string
Detail string
Attach string
GoodsTag string
NotifyUrl string
}
// Config 是传出用于 js sdk 用的参数
@@ -145,12 +149,23 @@ func (pcf *Pay) PrePayOrder(p *Params) (payOrder PreOrder, err error) {
param["body"] = p.Body
param["mch_id"] = pcf.PayMchID
param["nonce_str"] = nonceStr
param["notify_url"] = pcf.PayNotifyURL
param["out_trade_no"] = p.OutTradeNo
param["spbill_create_ip"] = p.CreateIP
param["total_fee"] = p.TotalFee
param["trade_type"] = p.TradeType
param["openid"] = p.OpenID
param["detail"] = p.Detail
param["attach"] = p.Attach
param["goods_tag"] = p.GoodsTag
param["notify_url"] = pcf.PayNotifyURL
// 签名类型
if p.SignType != "" {
param["sign_type"] = p.SignType
}
// 通知地址
if p.NotifyUrl != "" {
param["notify_url"] = p.NotifyUrl
}
bizKey := "&key=" + pcf.PayKey
str := orderParam(param, bizKey)