Documentation ¶
Index ¶
Constants ¶
View Source
const ( //CacheKeyOfficialAccountPrefix 微信公众号cache key前缀 CacheKeyOfficialAccountPrefix = "gowechat_officialaccount_" //CacheKeyMiniProgramPrefix 小程序cache key前缀 CacheKeyMiniProgramPrefix = "gowechat_miniprogram_" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessTokenHandle ¶
AccessTokenHandle AccessToken 接口
func NewDefaultAccessToken ¶
func NewDefaultAccessToken(appID, appSecret, cacheKeyPrefix string, cache cache.Cache) AccessTokenHandle
NewDefaultAccessToken new DefaultAccessToken
type AuthorizationHandle ¶
type AuthorizationHandle interface {
GetAuthorization(method, url, timestamp, nonceStr string, body []byte) (authorization string, err error)
}
AuthorizationHandle 获取微信支付的认证信息
func NewDefaultAuthorization ¶
func NewDefaultAuthorization(mchID, serialNo string) AuthorizationHandle
NewDefaultAuthorization 创建微信支付的认证信息
type DefaultAccessToken ¶
type DefaultAccessToken struct {
// contains filtered or unexported fields
}
DefaultAccessToken 默认AccessToken 获取
func (*DefaultAccessToken) GetAccessToken ¶
func (ak *DefaultAccessToken) GetAccessToken() (accessToken string, err error)
GetAccessToken 获取access_token,先从cache中获取,没有则从服务端获取
type DefaultAuthorization ¶
DefaultAuthorization 微信支付的认证信息
func (*DefaultAuthorization) GetAuthorization ¶
func (da *DefaultAuthorization) GetAuthorization(method, url, timestamp, nonceStr string, body []byte) (authorization string, err error)
GetAuthorization 获取认证信息
type ResAccessToken ¶
type ResAccessToken struct { common.Error AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
ResAccessToken struct
func GetTokenFromServer ¶
func GetTokenFromServer(appID, appSecret string) (resAccessToken ResAccessToken, err error)
GetTokenFromServer 强制从微信服务器获取token
Click to show internal directories.
Click to hide internal directories.