Documentation
¶
Index ¶
- func LimitString(str string, length int) string
- func NewRandStr(length int) string
- func RegisterHook(hook func(req *http.Request, reqBody []byte, res *http.Response, err error))
- func SafeString(str string, length int) string
- type H
- type MchAccount
- func (ma MchAccount) NewMchReq(api mch_api.MchApi) (req *mchReq)
- func (ma MchAccount) NewMchReqV3(api mch_api.MchApi) (req *mchReqV3)
- func (ma MchAccount) NewMchReqWithApp(api mch_api.MchApi, appId string) (req *mchReq)
- func (ma MchAccount) OrderSign(or mch_api.PayUnifiedOrderRes) map[string]interface{}
- func (ma MchAccount) OrderSign4App(or mch_api.PayUnifiedOrderRes) map[string]interface{}
- func (ma MchAccount) PayNotify(pn mch_api.PayNotify) bool
- func (ma MchAccount) RsaEncrypt(plain string) (out string)
- type MpAccount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LimitString ¶
LimitString 限制长度,并将微信不支持的字符替换成'x',能满足公众号App的字符要求
func RegisterHook ¶ added in v1.2.2
func SafeString ¶
SafeString 安全地限制长度,并将微信不支持的字符替换成'x',能满足商户平台的字符要求
Types ¶
type MchAccount ¶
type MchAccount struct { MchId string MchKey string MchSSLCert []byte // 私有加密传输时的证书 MchSSLKey []byte // 私有加密传输时的密钥 MchRSAPublicKey []byte // 加密银行卡信息时用的公钥 }
MchAccount 商户账号
func (MchAccount) NewMchReq ¶
func (ma MchAccount) NewMchReq(api mch_api.MchApi) (req *mchReq)
NewMchReq 创建请求
func (MchAccount) NewMchReqV3 ¶ added in v1.2.0
func (ma MchAccount) NewMchReqV3(api mch_api.MchApi) (req *mchReqV3)
NewMchReqV3 创建请求
func (MchAccount) NewMchReqWithApp ¶
func (ma MchAccount) NewMchReqWithApp(api mch_api.MchApi, appId string) (req *mchReq)
NewMchReqWithApp 创建请求
func (MchAccount) OrderSign ¶
func (ma MchAccount) OrderSign(or mch_api.PayUnifiedOrderRes) map[string]interface{}
OrderSign 订单签名,适用于H5、小程序
func (MchAccount) OrderSign4App ¶
func (ma MchAccount) OrderSign4App(or mch_api.PayUnifiedOrderRes) map[string]interface{}
OrderSign4App 订单签名给App
func (MchAccount) PayNotify ¶
func (ma MchAccount) PayNotify(pn mch_api.PayNotify) bool
PayNotify 验证支付成功通知
func (MchAccount) RsaEncrypt ¶
func (ma MchAccount) RsaEncrypt(plain string) (out string)
RsaEncrypt 银行卡机要信息加密
type MpAccount ¶
type MpAccount struct { AppId string `json:"app_id"` AccessToken string `json:"access_token"` AppSecret string `json:"app_secret"` PrivateToken string `json:"private_token"` EncodingAESKey string `json:"encoding_aes_key"` JsSdkTicket string `json:"js_sdk_ticket"` ServerHost mp_api.ServerHost `json:"server_host"` }
MpAccount 应用账号 ServerHost 默认为:mp_api.ServerHostUniversal
func (MpAccount) ReadMessage ¶
func (ma MpAccount) ReadMessage(req *http.Request) (q mp_api.MessageQuery, msg mp_api.MessageData, err error)
ReadMessage 读取通知消息
Source Files
¶
Click to show internal directories.
Click to hide internal directories.