Documentation ¶
Index ¶
- func LimitString(str string, length int) string
- func NewRandStr(length int) string
- func SafeString(str string, length int) string
- type H
- type MchAccount
- func (ma MchAccount) NewMchReq(api mch_api.MchApi) (req *mchReq)
- 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 ¶
限制长度,并将微信不支持的字符替换成'x',能满足公众号App的字符要求
func SafeString ¶
安全地限制长度,并将微信不支持的字符替换成'x',能满足商户平台的字符要求
Types ¶
type MchAccount ¶
type MchAccount struct { MchId string MchName string MchKey string MchSSLCert []byte // 私有加密传输时的证书 MchSSLKey []byte // 私有加密传输时的密钥 MchRSAPublicKey []byte // 加密银行卡信息时用的公钥 }
商户账号
func (MchAccount) NewMchReqWithApp ¶
func (ma MchAccount) NewMchReqWithApp(api mch_api.MchApi, appId string) (req *mchReq)
创建请求
func (MchAccount) OrderSign ¶
func (ma MchAccount) OrderSign(or mch_api.PayUnifiedOrderRes) map[string]interface{}
订单签名,适用于H5、小程序
func (MchAccount) OrderSign4App ¶
func (ma MchAccount) OrderSign4App(or mch_api.PayUnifiedOrderRes) map[string]interface{}
订单签名给App
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"` }
应用账号 ServerHost 默认为:mp_api.ServerHostUniversal
func (MpAccount) ReadMessage ¶
读取通知消息
Click to show internal directories.
Click to hide internal directories.