- update wechat

master
李光春 1 year ago
parent bf3c02d004
commit 535d75c175

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.128"
return "1.0.129"
}

@ -12,7 +12,7 @@ type redisCachePrefixFun func() (wechatAccessToken string)
// ClientConfig 实例配置
type ClientConfig struct {
AppId string // 小程序唯一凭证,即 appId
AppId string `json:"app_id"` // 小程序唯一凭证,即 appId
AppSecret string // 小程序唯一凭证密钥,即 appSecret
}

@ -15,6 +15,8 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置请求地址
client.SetUri(url)
client.SetHeader("app_id", c.GetAppId())
// 设置方式
client.SetMethod(method)

@ -13,7 +13,7 @@ type redisCachePrefixFun func() (wechatAccessToken, wechatJsapiTicket string)
// ClientConfig 实例配置
type ClientConfig struct {
AppId string // 小程序唯一凭证,即 appId
AppId string `json:"app_id"` // 小程序唯一凭证,即 appId
AppSecret string // 小程序唯一凭证密钥,即 appSecret
RedisClient *dorm.RedisClient // 缓存数据库
RedisCachePrefixFun redisCachePrefixFun // 缓存前缀

@ -15,6 +15,8 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置请求地址
client.SetUri(url)
client.SetHeader("app_id", c.GetAppId())
// 设置方式
client.SetMethod(method)

@ -15,8 +15,8 @@ type redisCachePrefixFun func() (componentVerifyTicket, componentAccessToken, au
// ClientConfig 实例配置
type ClientConfig struct {
AuthorizerAppid string // 授权方 appid
ComponentAppId string // 第三方平台 appid
AuthorizerAppid string `json:"authorizer_appid"` // 授权方 appid
ComponentAppId string `json:"component_app_id"` // 第三方平台 appid
ComponentAppSecret string // 第三方平台 app_secret
MessageToken string
MessageKey string

@ -14,6 +14,9 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置请求地址
client.SetUri(url)
client.SetHeader("component_app_id", c.GetComponentAppId())
client.SetHeader("authorizer_appid", c.GetAuthorizerAppid())
// 设置方式
client.SetMethod(method)

@ -7,9 +7,9 @@ import (
// ClientConfig 实例配置
type ClientConfig struct {
AppId string // 小程序或者公众号唯一凭证
AppId string `json:"app_id"` // 小程序或者公众号唯一凭证
AppSecret string // 小程序或者公众号唯一凭证密钥
MchId string // 微信支付的商户id
MchId string `json:"mch_id"` // 微信支付的商户id
MchKey string // 私钥
CertString string
KeyString string

@ -15,6 +15,9 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置请求地址
client.SetUri(url)
client.SetHeader("app_id", c.GetAppId())
client.SetHeader("mch_id", c.GetMchId())
// 设置格式
client.SetContentTypeXml()

@ -7,9 +7,9 @@ import (
// ClientConfig 实例配置
type ClientConfig struct {
AppId string // 小程序或者公众号唯一凭证
AppId string `json:"app_id"` // 小程序或者公众号唯一凭证
AppSecret string // 小程序或者公众号唯一凭证密钥
MchId string // 微信支付的商户id
MchId string `json:"mch_id"` // 微信支付的商户id
AesKey string // 私钥
ApiV3 string // API v3密钥
MchSslSerialNo string // pem 证书号

@ -29,6 +29,9 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置请求地址
client.SetUri(url)
client.SetHeader("app_id", c.GetAppId())
client.SetHeader("mch_id", c.GetMchId())
// 设置方式
client.SetMethod(method)

@ -7,8 +7,8 @@ import (
// ClientConfig 实例配置
type ClientConfig struct {
SpAppid string // 服务商应用ID
SpMchId string // 服务商户号
SpAppid string `json:"sp_appid"` // 服务商应用ID
SpMchId string `json:"sp_mch_id"` // 服务商户号
ApiV2 string // APIv2密钥
ApiV3 string // APIv3密钥
SerialNo string // 序列号

@ -20,6 +20,11 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置请求地址
client.SetUri(url)
client.SetHeader("sp_appid", c.GetSpAppid())
client.SetHeader("sp_mch_id", c.GetSpMchId())
client.SetHeader("sub_appid", c.GetSubAppid())
client.SetHeader("sub_mch_id", c.GetSubMchId())
// 设置方式
client.SetMethod(method)

@ -12,7 +12,7 @@ type redisCachePrefixFun func() (wechatAccessToken string)
// ClientConfig 实例配置
type ClientConfig struct {
AppId string // 小程序唯一凭证,即 appId
AppId string `json:"app_id"` // 小程序唯一凭证,即 appId
AppSecret string // 小程序唯一凭证密钥,即 appSecret
Pid string // 推广位PID
RedisClient *dorm.RedisClient // 缓存数据库

@ -15,6 +15,8 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置请求地址
client.SetUri(url)
client.SetHeader("app_id", c.GetAppId())
// 设置请求方式
client.SetMethod(method)

Loading…
Cancel
Save