|
|
@@ -21,6 +21,7 @@ var wxConfig struct {
|
|
|
Token string // 设置token
|
|
|
EncodingAseKey string // ase key
|
|
|
PayMchId string // 商户号id
|
|
|
+ PaySubMchId string // 子商户号(受理机构必须传这个)
|
|
|
PayKey string // 商户支付设置的key
|
|
|
RedirectUrl string // 微信Oauth完整跳转uri
|
|
|
Scope string // 微信Oauth的scope
|
|
|
@@ -36,13 +37,14 @@ func init() {
|
|
|
wxConfig.Token = config.AppConfig.GetKey("token")
|
|
|
wxConfig.EncodingAseKey = config.AppConfig.GetKey("encoding_aes_key")
|
|
|
wxConfig.PayMchId = config.AppConfig.GetKey("mch_id") // 商户号id
|
|
|
+ wxConfig.PaySubMchId = config.AppConfig.GetKey("sub_mch_id")
|
|
|
wxConfig.PayKey = config.AppConfig.GetKey("pay_key") // 商户支付设置的key
|
|
|
wxConfig.RedirectUrl = config.AppConfig.GetKey("redirect_url")
|
|
|
wxConfig.Scope = config.AppConfig.GetKey("scope")
|
|
|
wxConfig.ResponseType = config.AppConfig.GetKey("response_type")
|
|
|
wxConfig.State = config.AppConfig.GetKey("state")
|
|
|
|
|
|
- config := &wechat.Config{wxConfig.AppId, wxConfig.AppSecret, wxConfig.Token, wxConfig.EncodingAseKey, wxConfig.PayMchId, wxConfig.WxPayCallback, wxConfig.PayKey, c}
|
|
|
+ config := &wechat.Config{wxConfig.AppId, wxConfig.AppSecret, wxConfig.Token, wxConfig.EncodingAseKey, wxConfig.PayMchId, wxConfig.PaySubMchId, wxConfig.WxPayCallback, wxConfig.PayKey, c}
|
|
|
wc = wechat.NewWechat(config)
|
|
|
wxoauth = wc.GetOauth()
|
|
|
}
|