Documentation ¶
Index ¶
- Variables
- func AliyunMoneyFeeToString(moneyFee float64) string
- func FilterTheSpecialSymbol(data string) string
- func GetAlipay(url string) (common.AliWebQueryResult, error)
- func GetAlipayApp(urls string) (common.AliWebAppQueryResult, error)
- func InitAliAppClient(c *AliAppClient)
- func InitAliWebClient(c *AliWebClient)
- func InitWxAppClient(c *WxAppClient)
- func InitWxMiniProgramClient(c *WxMPClient)
- func InitWxWebClient(c *WxWebClient)
- func PostWx(url string, data map[string]string, h *HTTPSClient) (common.WxQueryResult, error)
- func ToURL(payUrl string, m map[string]string) string
- func TruncatedText(data string, length int) string
- func WxCloseOrder(appid, mchid, key string, outTradeNo string) (common.WxQueryResult, error)
- func WxCompanyChange(mchAppid, mchid, key string, conn *HTTPSClient, charge *common.Charge) (map[string]string, error)
- func WxGenSign(key string, m map[string]string) (string, error)
- func WxMoneyFeeToString(moneyFee float64) string
- func WxQueryOrder(appID, mchID, key, tradeNum string) (common.WxQueryResult, error)
- type AliAppClient
- type AliPayClient
- type AliWebClient
- func (client *AliWebClient) CheckSign(signData, sign string)
- func (client *AliWebClient) CloseOrder(charge *common.Charge) (map[string]string, error)
- func (client *AliWebClient) GenSign(m map[string]string) string
- func (client *AliWebClient) Pay(charge *common.Charge) (map[string]string, error)
- func (client *AliWebClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (client *AliWebClient) QueryOrder(outTradeNo string) (common.AliWebQueryResult, error)
- type HTTPClient
- type HTTPSClient
- type WxAppClient
- func (client *WxAppClient) CloseOrder(outTradeNo string) (common.WxQueryResult, error)
- func (client *WxAppClient) Pay(charge *common.Charge) (map[string]string, error)
- func (client *WxAppClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (client *WxAppClient) QueryOrder(tradeNum string) (common.WxQueryResult, error)
- type WxClient
- type WxMPClient
- func (client *WxMPClient) CloseOrder(outTradeNo string) (common.WxQueryResult, error)
- func (client *WxMPClient) Pay(charge *common.Charge) (map[string]string, error)
- func (client *WxMPClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (client *WxMPClient) QueryOrder(tradeNum string) (common.WxQueryResult, error)
- type WxWebClient
- func (client *WxWebClient) CloseOrder(outTradeNo string) (common.WxQueryResult, error)
- func (client *WxWebClient) Pay(charge *common.Charge) (map[string]string, error)
- func (client *WxWebClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (client *WxWebClient) QueryOrder(tradeNum string) (common.WxQueryResult, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HTTPC *HTTPClient HTTPSC *HTTPSClient )
Functions ¶
func AliyunMoneyFeeToString ¶
AliyunMoneyFeeToString 支付宝金额转字符串
func FilterTheSpecialSymbol ¶
FilterTheSpecialSymbol 过滤特殊符号
func GetAlipayApp ¶
func GetAlipayApp(urls string) (common.AliWebAppQueryResult, error)
GetAlipayApp 对支付宝者查订单
func InitAliAppClient ¶
func InitAliAppClient(c *AliAppClient)
func InitAliWebClient ¶
func InitAliWebClient(c *AliWebClient)
func InitWxAppClient ¶
func InitWxAppClient(c *WxAppClient)
func InitWxMiniProgramClient ¶
func InitWxMiniProgramClient(c *WxMPClient)
func InitWxWebClient ¶
func InitWxWebClient(c *WxWebClient)
func PostWx ¶
func PostWx(url string, data map[string]string, h *HTTPSClient) (common.WxQueryResult, error)
PostWx 对微信下订单或者查订单
func TruncatedText ¶
func WxCloseOrder ¶
func WxCloseOrder(appid, mchid, key string, outTradeNo string) (common.WxQueryResult, error)
WxCloseOrder 微信关闭订单
func WxCompanyChange ¶
func WxCompanyChange(mchAppid, mchid, key string, conn *HTTPSClient, charge *common.Charge) (map[string]string, error)
WxCompanyChange 微信企业付款到零钱
func WxMoneyFeeToString ¶
WxMoneyFeeToString 微信金额浮点转字符串
func WxQueryOrder ¶
func WxQueryOrder(appID, mchID, key, tradeNum string) (common.WxQueryResult, error)
WxQueryOrder 微信订单查询
Types ¶
type AliAppClient ¶
type AliAppClient struct { AliPayClient SellerID string //合作者ID }
func DefaultAliAppClient ¶
func DefaultAliAppClient() *AliAppClient
DefaultAliAppClient 得到默认支付宝app客户端
func (*AliAppClient) CloseOrder ¶
func (*AliAppClient) QueryOrder ¶
func (client *AliAppClient) QueryOrder(outTradeNo string) (common.AliWebAppQueryResult, error)
订单查询
type AliPayClient ¶
type AliPayClient struct { AppID string // 应用ID PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey RSAType string // RSA or RSA2 PayURL string // https://openapi.alipay.com/gateway.do }
func (*AliPayClient) CheckSign ¶
func (client *AliPayClient) CheckSign(signData, sign string)
CheckSign 检测签名
func (*AliPayClient) GenSign ¶
func (client *AliPayClient) GenSign(m map[string]string) string
GenSign 产生签名
func (*AliPayClient) PayToClient ¶
type AliWebClient ¶
type AliWebClient struct { AliPayClient PartnerID string // 支付宝合作身份ID SellerID string // 卖家支付宝用户号 }
AliWebClient 支付宝网页支付 PayURL: https://mapi.alipay.com/gateway.do"
func DefaultAliWebClient ¶
func DefaultAliWebClient() *AliWebClient
DefaultAliWebClient 默认支付宝网页支付客户端
func (*AliWebClient) CheckSign ¶
func (client *AliWebClient) CheckSign(signData, sign string)
CheckSign 检测签名
func (*AliWebClient) CloseOrder ¶
func (*AliWebClient) GenSign ¶
func (client *AliWebClient) GenSign(m map[string]string) string
GenSign 产生签名
func (*AliWebClient) PayToClient ¶
func (*AliWebClient) QueryOrder ¶
func (client *AliWebClient) QueryOrder(outTradeNo string) (common.AliWebQueryResult, error)
订单查询
type HTTPClient ¶
HTTPClient http客户端
type HTTPSClient ¶
HTTPSClient HTTPS客户端结构
func NewHTTPSClient ¶
func NewHTTPSClient(certPEMBlock, keyPEMBlock []byte) *HTTPSClient
NewHTTPSClient 获取默认https客户端
type WxAppClient ¶
type WxAppClient struct {
WxClient
}
WxAppClient 微信app支付
func (*WxAppClient) CloseOrder ¶
func (client *WxAppClient) CloseOrder(outTradeNo string) (common.WxQueryResult, error)
关闭订单
func (*WxAppClient) PayToClient ¶
支付到用户的微信账号
func (*WxAppClient) QueryOrder ¶
func (client *WxAppClient) QueryOrder(tradeNum string) (common.WxQueryResult, error)
QueryOrder 查询订单
type WxClient ¶
type WxClient struct { AppID string // 公众账号ID MchID string // 商户号ID Key string // 密钥 PrivateKey []byte // 私钥文件内容 PublicKey []byte // 公钥文件内容 PayURL string // "https://api.mch.weixin.qq.com/pay/unifiedorder" // contains filtered or unexported fields }
WxClient
type WxMPClient ¶
type WxMPClient struct {
WxClient
}
WxMPClient 微信小程序
func DefaultWxMPClient ¶
func DefaultWxMPClient() *WxMPClient
func (*WxMPClient) CloseOrder ¶
func (client *WxMPClient) CloseOrder(outTradeNo string) (common.WxQueryResult, error)
关闭订单
func (*WxMPClient) PayToClient ¶
支付到用户的微信账号
func (*WxMPClient) QueryOrder ¶
func (client *WxMPClient) QueryOrder(tradeNum string) (common.WxQueryResult, error)
QueryOrder 查询订单
type WxWebClient ¶
type WxWebClient struct {
WxClient
}
WxWebClient 微信公众号支付
func DefaultWxWebClient ¶
func DefaultWxWebClient() *WxWebClient
func (*WxWebClient) CloseOrder ¶
func (client *WxWebClient) CloseOrder(outTradeNo string) (common.WxQueryResult, error)
关闭订单
func (*WxWebClient) PayToClient ¶
支付到用户的微信账号
func (*WxWebClient) QueryOrder ¶
func (client *WxWebClient) QueryOrder(tradeNum string) (common.WxQueryResult, error)
QueryOrder 查询订单
Click to show internal directories.
Click to hide internal directories.