tools

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthCodeToOpenId

func AuthCodeToOpenId(clt *core.Client, req map[string]string) (resp map[string]string, err error)

AuthCodeToOpenId 授权码查询openid.

func ShortURL

func ShortURL(clt *core.Client, req map[string]string) (resp map[string]string, err error)

ShortURL 转换短链接.

Types

type AuthCodeToOpenIdRequest

type AuthCodeToOpenIdRequest struct {
	XMLName struct{} `xml:"xml" json:"-"`

	// 必选参数
	AuthCode string `xml:"auth_code"` // 扫码支付授权码,设备读取用户微信中的条码或者二维码信息

	// 可选参数
	NonceStr string `xml:"nonce_str"` // 随机字符串,不长于32位。NOTE: 如果为空则系统会自动生成一个随机字符串。
	SignType string `xml:"sign_type"` // 签名类型,默认为MD5,支持HMAC-SHA256和MD5。
}

type AuthCodeToOpenIdResponse

type AuthCodeToOpenIdResponse struct {
	XMLName struct{} `xml:"xml" json:"-"`

	// 必选返回
	OpenId string `xml:"openid"` // 用户在商户appid下的唯一标识

	// 下面字段都是可选返回的(详细见微信支付文档), 为空值表示没有返回, 程序逻辑里需要判断
	SubOpenId string `xml:"sub_openid"` // 用户在子商户appid下的唯一标识
}

func AuthCodeToOpenId2

func AuthCodeToOpenId2(clt *core.Client, req *AuthCodeToOpenIdRequest) (resp *AuthCodeToOpenIdResponse, err error)

AuthCodeToOpenId2 授权码查询openid.

type ShortURLRequest

type ShortURLRequest struct {
	XMLName struct{} `xml:"xml" json:"-"`

	// 必选参数
	LongURL string `xml:"long_url"` // URL链接

	// 可选参数
	NonceStr string `xml:"nonce_str"` // 随机字符串,不长于32位。NOTE: 如果为空则系统会自动生成一个随机字符串。
	SignType string `xml:"sign_type"` // 签名类型,默认为MD5,支持HMAC-SHA256和MD5。
}

type ShortURLResponse

type ShortURLResponse struct {
	XMLName struct{} `xml:"xml" json:"-"`

	// 必选返回
	ShortURL string `xml:"short_url"` // 转换后的URL
}

func ShortURL2

func ShortURL2(clt *core.Client, req *ShortURLRequest) (resp *ShortURLResponse, err error)

ShortURL2 转换短链接.

Jump to

Keyboard shortcuts

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