wechat

package
v0.15.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy()

func GetAccessToken added in v0.1.2

func GetAccessToken(appID string, appSecret string) (string, error)

func GetUserPhone added in v0.8.5

func GetUserPhone(appID string, appSecret string, code string) (string, error)

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func LoginWeb added in v0.9.6

func LoginWeb(appID, appSecret, code string) (string, string, error)

func MiniQr

func MiniQr(wechatAppID string, secret string, path string) (string, error)

func MsgSecCheck added in v0.7.0

func MsgSecCheck(wechatAppID string, appSecret string, content string, scene int, openID string) ([]MsgSecCheckDetail, *MsgSecCheckTotal, error)

func Notified added in v0.7.0

func Notified(tradeID string, msg string) error

func SendMpMsg added in v0.9.40

func SendMpMsg(wechatAppID, appSecret, toUser, miniAppID, page, templateID string,
	data map[string]interface{}) error

func SendSubscribeMessage added in v0.8.5

func SendSubscribeMessage(appID string, appSecret string, msg string) error

func SendTemplateSubscribeMessage

func SendTemplateSubscribeMessage(wechatAppID string, appSecret string, toUser string, templateID string,
	data map[string]interface{}) error

Types

type CreateUnifiedOrderResult

type CreateUnifiedOrderResult struct {
	TimeStamp string `json:"timeStamp"`
	Nonce     string `json:"nonce"`
	Package   string `json:"package"`
	SignType  string `json:"signType"`
	PaySign   string `json:"paySign"`
}

type GetAccessTokenResponse added in v0.1.2

type GetAccessTokenResponse struct {
	AccessToken string `json:"access_token"`
	// contains filtered or unexported fields
}

type GetUserFollowOfficialAccountListResponse added in v0.8.5

type GetUserFollowOfficialAccountListResponse struct {
	GetUserFollowOfficialAccountListResult
	// contains filtered or unexported fields
}

type GetUserFollowOfficialAccountListResult added in v0.8.5

type GetUserFollowOfficialAccountListResult struct {
	Total      int64    `json:"total"`
	Count      int64    `json:"count"`
	Openid     []string `json:"openid"`
	NextOpenid string   `json:"next_openid"`
}

func GetUserFollowOfficialAccountList added in v0.8.5

func GetUserFollowOfficialAccountList(appID string, appSecret string, nextOpenid string) (*GetUserFollowOfficialAccountListResult, error)

type GetUserOfficialAccountInfoResponse added in v0.8.5

type GetUserOfficialAccountInfoResponse struct {
	GetUserOfficialAccountInfoResult
	// contains filtered or unexported fields
}

type GetUserOfficialAccountInfoResult added in v0.8.5

type GetUserOfficialAccountInfoResult struct {
	Subscribe      int    `json:"subscribe"`
	Openid         string `json:"openid"`
	SubscribeTime  string `json:"subscribeTime"`
	UnionID        string `json:"unionID"`
	Remark         string `json:"remark"`
	SubscribeScene string `json:"subscribeScene"`
}

func GetUserOfficialAccountInfo added in v0.8.5

func GetUserOfficialAccountInfo(appID string, appSecret string, openid string) (*GetUserOfficialAccountInfoResult, error)

type LoginInfo added in v0.8.5

type LoginInfo struct {
	OpenID     string
	SessionKey string
	UnionID    string
}

func LoginWechat added in v0.8.5

func LoginWechat(appID string, appSecret string, jsCode string) (*LoginInfo, error)

type LoginResponse added in v0.8.5

type LoginResponse struct {
	OpenID     string `json:"openId" binding:"required"`
	SessionKey string `json:"sessionKey" binding:"required"`
	UnionID    string `json:"unionId" binding:"required"`
	// contains filtered or unexported fields
}

type LoginWebRequest added in v0.9.6

type LoginWebRequest struct {
	AppID     string `json:"appId" binding:"required"`
	AppSecret string `json:"appSecret" binding:"required"`
	Code      string `json:"Code" binding:"required"`
}

type LoginWebResponse added in v0.9.6

type LoginWebResponse struct {
	OpenID  string `json:"openId" binding:"required"`
	UnionID string `json:"unionId" binding:"required"`
	// contains filtered or unexported fields
}

type MsgSecCheckDetail added in v0.7.0

type MsgSecCheckDetail struct {
	Strategy string `json:"strategy" binding:"required"`
	ErrCode  int    `json:"errCode"`
	Suggest  string `json:"suggest" binding:"required"`
	Label    int    `json:"label" binding:"required"`
	Keyword  string `json:"keyword" binding:"required"`
	Prob     int    `json:"prob"`
}

type MsgSecCheckRequest added in v0.7.0

type MsgSecCheckRequest struct {
	AppID     string `json:"appId" binding:"required"`
	AppSecret string `json:"appSecret" binding:"required"`
	Content   string `json:"content" binding:"required"`
	Scene     int    `json:"scene" binding:"required"`
	OpenID    string `json:"openId" binding:"required"`
}

type MsgSecCheckResponse added in v0.7.0

type MsgSecCheckResponse struct {
	Detail []MsgSecCheckDetail
	Result MsgSecCheckTotal
	// contains filtered or unexported fields
}

type MsgSecCheckTotal added in v0.7.0

type MsgSecCheckTotal struct {
	Suggest string `json:"suggest" binding:"required"`
	Label   int    `json:"label" binding:"required"`
}

type NotifiedRequest added in v0.7.0

type NotifiedRequest struct {
	OutTradeID string `json:"outTradeId"`
	Msg        string `json:"msg"`
}

type SendMpMessageRequest added in v0.9.47

type SendMpMessageRequest struct {
	AppID            string                 `json:"appId" binding:"required"`
	AppSecret        string                 `json:"appSecret" binding:"required"`
	MiniProgramAppID string                 `json:"miniProgramAppId"`
	ToUser           string                 `json:"touser" binding:"required"`
	Page             string                 `json:"pagepath"`
	TemplateID       string                 `json:"templateId" binding:"required"`
	Data             map[string]interface{} `json:"data" binding:"required"`
}

type SendTemplateSubscribeMessageRequest

type SendTemplateSubscribeMessageRequest struct {
	AppID      string                 `json:"appId" binding:"required"`
	AppSecret  string                 `json:"appSecret" binding:"required"`
	ToUser     string                 `json:"touser" binding:"required"`
	TemplateID string                 `json:"templateId" binding:"required"`
	Page       string                 `json:"page"`
	Data       map[string]interface{} `json:"data" binding:"required"`
}

type UnifiedOrderRequest

type UnifiedOrderRequest struct {
	OpenID     string `json:"openId"`
	AppID      string `json:"appId"`
	MchID      string `json:"mchId"`
	MchKey     string `json:"mchKey"`
	Body       string `json:"body"`
	OutTradeNo string `json:"outTradeNo"`
	TotalFee   int    `json:"totalFee"`
	TerminalIP string `json:"terminalIP"`
	NotifyUrl  string `json:"notifyUrl"`
}

type UnifiedOrderResponse

type UnifiedOrderResponse struct {
	TimeStamp string `json:"timeStamp"`
	Nonce     string `json:"nonce"`
	Package   string `json:"package"`
	SignType  string `json:"signType"`
	PaySign   string `json:"paySign"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL