Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(text string) (bool, string)
- func DecryptMsg(msgSignature string, timeStamp string, nonce string, postData string) (bool, string)
- func GetAccessToken() string
- func GetTicket() string
- func GetWXJSConfig(url string) (appId string, timestamp int64, nonceStr string, signature string)
- func OrderJS(OrderNo string, ShopName string, DetailJSON string, Host string, openid string, ...)
- type AccessToken
- type PushInfo
- type Ticket
- type TokenXML
- type WXDetail
- type WXGoodsDetail
Constants ¶
View Source
const AppID = "wx037d3b26b2ba34b2"
View Source
const AppSecret = "fe3faa4e6f8abd87fa4621cb5ed5f725"
View Source
const EncodingAESKey = "egMWQnCkbuDd7u5GM7EJBnH8mISn5iwAorjRNnFx3dv"
View Source
const MchID = "1342120901"
View Source
const Token = "30e6e3b03bf7ec6d2ce56a50055e1cd1"
Variables ¶
Functions ¶
func DecryptMsg ¶
func GetAccessToken ¶
func GetAccessToken() string
func Api_create_preauthcode(component_access_token string) string { if time.Now().Unix()-VerifyCache.Pre_auth_code_update >= VerifyCache.Pre_auth_code_expires_in-10 || strings.EqualFold(VerifyCache.Pre_auth_code, "") { params := map[string]string{"component_appid": OpenAppID} jd, err := json.Marshal(params) glog.Error(err) fmt.Println(string(jd)) buf := bytes.NewBuffer(make([]byte, 0)) binary.Write(buf, binary.BigEndian, jd) resp, err := http.Post("https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?component_access_token="+component_access_token, "application/json", buf) glog.Error(err) b, err := ioutil.ReadAll(resp.Body) glog.Error(err) fmt.Println(string(b)) var respData = &struct { Pre_auth_code string `json:"pre_auth_code"` Expires_in int64 `json:"expires_in"` }{} err = json.Unmarshal(b, respData) glog.Error(err) VerifyCache.Pre_auth_code = respData.Pre_auth_code VerifyCache.Pre_auth_code_expires_in = respData.Expires_in VerifyCache.Pre_auth_code_update = time.Now().Unix() fmt.Println(respData) return VerifyCache.Pre_auth_code } else { return VerifyCache.Pre_auth_code } }
func GetWXJSConfig ¶
Types ¶
type AccessToken ¶
type WXDetail ¶
type WXDetail struct {
Goods_detail []WXGoodsDetail `json:"goods_detail"`
}
Click to show internal directories.
Click to hide internal directories.