Documentation ¶
Index ¶
- Variables
- func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte)
- 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 *WechatAppClient)
- func InitWxMiniProgramClient(c *WechatMiniProgramClient)
- func InitWxWebClient(c *WechatWebClient)
- func PostWechat(url string, data map[string]string, h *HTTPSClient) (common.WeChatQueryResult, error)
- func ToURL(payUrl string, m map[string]string) string
- func TruncatedText(data string, length int) string
- func WachatCloseOrder(appid, mchid, key string, outTradeNo string) (common.WeChatQueryResult, error)
- func WachatCompanyChange(mchAppid, mchid, key string, conn *HTTPSClient, charge *common.Charge) (map[string]string, error)
- func WachatQueryOrder(appID, mchID, key, tradeNum string) (common.WeChatQueryResult, error)
- func WechatDecode(data string, key string) ([]byte, error)
- func WechatGenSign(key string, m map[string]string) (string, error)
- func WechatMoneyFeeToString(moneyFee float64) string
- type AliAppClient
- type AliPayClient
- type AliWebClient
- func (this *AliWebClient) CheckSign(signData, sign string)
- func (this *AliWebClient) CloseOrder(charge *common.Charge) (map[string]string, error)
- func (this *AliWebClient) GenSign(m map[string]string) string
- func (this *AliWebClient) Pay(charge *common.Charge) (map[string]string, error)
- func (this *AliWebClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (this *AliWebClient) QueryOrder(outTradeNo string) (common.AliWebQueryResult, error)
- type HTTPClient
- type HTTPSClient
- type WechatAppClient
- func (this *WechatAppClient) CloseOrder(outTradeNo string) (common.WeChatQueryResult, error)
- func (this *WechatAppClient) Pay(charge *common.Charge) (map[string]string, error)
- func (this *WechatAppClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (this *WechatAppClient) QueryOrder(tradeNum string) (common.WeChatQueryResult, error)
- type WechatMiniProgramClient
- func (this *WechatMiniProgramClient) CloseOrder(outTradeNo string) (common.WeChatQueryResult, error)
- func (this *WechatMiniProgramClient) Pay(charge *common.Charge) (map[string]string, error)
- func (this *WechatMiniProgramClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (this *WechatMiniProgramClient) QueryOrder(tradeNum string) (common.WeChatQueryResult, error)
- func (this *WechatMiniProgramClient) Refund(charge *common.RefundCharge) (map[string]string, error)
- type WechatWebClient
- func (this *WechatWebClient) CloseOrder(outTradeNo string) (common.WeChatQueryResult, error)
- func (this *WechatWebClient) Pay(charge *common.Charge) (map[string]string, error)
- func (this *WechatWebClient) PayToClient(charge *common.Charge) (map[string]string, error)
- func (this *WechatWebClient) QueryOrder(tradeNum string) (common.WeChatQueryResult, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HTTPC *HTTPClient HTTPSC *HTTPSClient )
Functions ¶
func AesDecryptECB ¶
func InitAliAppClient ¶
func InitAliAppClient(c *AliAppClient)
func InitAliWebClient ¶
func InitAliWebClient(c *AliWebClient)
func InitWxAppClient ¶
func InitWxAppClient(c *WechatAppClient)
func InitWxMiniProgramClient ¶
func InitWxMiniProgramClient(c *WechatMiniProgramClient)
func InitWxWebClient ¶
func InitWxWebClient(c *WechatWebClient)
func PostWechat ¶
func PostWechat(url string, data map[string]string, h *HTTPSClient) (common.WeChatQueryResult, error)
对微信下订单或者查订单
func TruncatedText ¶
func WachatCloseOrder ¶
func WachatCloseOrder(appid, mchid, key string, outTradeNo string) (common.WeChatQueryResult, error)
微信关闭订单
func WachatCompanyChange ¶
func WachatCompanyChange(mchAppid, mchid, key string, conn *HTTPSClient, charge *common.Charge) (map[string]string, error)
微信企业付款到零钱
func WachatQueryOrder ¶
func WachatQueryOrder(appID, mchID, key, tradeNum string) (common.WeChatQueryResult, error)
微信订单查询
Types ¶
type AliAppClient ¶
type AliAppClient struct { *AliPayClient SellerID string //合作者ID }
func DefaultAliAppClient ¶
func DefaultAliAppClient() *AliAppClient
DefaultAliAppClient 得到默认支付宝app客户端
func (*AliAppClient) CloseOrder ¶
func (*AliAppClient) QueryOrder ¶
func (this *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 }
func (*AliPayClient) CheckSign ¶
func (this *AliPayClient) CheckSign(signData, sign string)
CheckSign 检测签名
func (*AliPayClient) GenSign ¶
func (this *AliPayClient) GenSign(m map[string]string) string
GenSign 产生签名
func (*AliPayClient) PayToClient ¶
type AliWebClient ¶
type AliWebClient struct { PartnerID string // 支付宝合作身份ID SellerID string // 卖家支付宝用户号 AppID string // 支付宝分配给开发者的应用ID ps: 查询订单用 CallbackURL string // 回调接口 PrivateKey *rsa.PrivateKey // 私钥 PublicKey *rsa.PublicKey // 公钥 }
AliWebClient 支付宝网页支付
func DefaultAliWebClient ¶
func DefaultAliWebClient() *AliWebClient
DefaultAliWebClient 默认支付宝网页支付客户端
func (*AliWebClient) CheckSign ¶
func (this *AliWebClient) CheckSign(signData, sign string)
CheckSign 检测签名
func (*AliWebClient) CloseOrder ¶
func (*AliWebClient) GenSign ¶
func (this *AliWebClient) GenSign(m map[string]string) string
GenSign 产生签名
func (*AliWebClient) PayToClient ¶
func (*AliWebClient) QueryOrder ¶
func (this *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 WechatAppClient ¶
type WechatAppClient struct { AppID string // 公众账号ID MchID string // 商户号ID Key string // 密钥 PrivateKey []byte // 私钥文件内容 PublicKey []byte // 公钥文件内容 // contains filtered or unexported fields }
WechatAppClient 微信app支付
func DefaultWechatAppClient ¶
func DefaultWechatAppClient() *WechatAppClient
DefaultWechatAppClient 默认微信app客户端
func (*WechatAppClient) CloseOrder ¶
func (this *WechatAppClient) CloseOrder(outTradeNo string) (common.WeChatQueryResult, error)
关闭订单
func (*WechatAppClient) PayToClient ¶
支付到用户的微信账号
func (*WechatAppClient) QueryOrder ¶
func (this *WechatAppClient) QueryOrder(tradeNum string) (common.WeChatQueryResult, error)
QueryOrder 查询订单
type WechatMiniProgramClient ¶
type WechatMiniProgramClient struct { AppID string // 公众账号ID MchID string // 商户号ID Key string // 密钥 PrivateKey []byte // 私钥文件内容 PublicKey []byte // 公钥文件内容 // contains filtered or unexported fields }
WechatMiniProgramClient 微信小程序
func DefaultWechatMiniProgramClient ¶
func DefaultWechatMiniProgramClient() *WechatMiniProgramClient
func (*WechatMiniProgramClient) CloseOrder ¶
func (this *WechatMiniProgramClient) CloseOrder(outTradeNo string) (common.WeChatQueryResult, error)
关闭订单
func (*WechatMiniProgramClient) PayToClient ¶
支付到用户的微信账号
func (*WechatMiniProgramClient) QueryOrder ¶
func (this *WechatMiniProgramClient) QueryOrder(tradeNum string) (common.WeChatQueryResult, error)
QueryOrder 查询订单
func (*WechatMiniProgramClient) Refund ¶
func (this *WechatMiniProgramClient) Refund(charge *common.RefundCharge) (map[string]string, error)
type WechatWebClient ¶
type WechatWebClient struct { AppID string // 公众账号ID MchID string // 商户号ID Key string // 密钥 PrivateKey []byte // 私钥文件内容 PublicKey []byte // 公钥文件内容 // contains filtered or unexported fields }
WechatWebClient 微信公众号支付
func DefaultWechatWebClient ¶
func DefaultWechatWebClient() *WechatWebClient
func (*WechatWebClient) CloseOrder ¶
func (this *WechatWebClient) CloseOrder(outTradeNo string) (common.WeChatQueryResult, error)
关闭订单
func (*WechatWebClient) PayToClient ¶
支付到用户的微信账号
func (*WechatWebClient) QueryOrder ¶
func (this *WechatWebClient) QueryOrder(tradeNum string) (common.WeChatQueryResult, error)
QueryOrder 查询订单
Click to show internal directories.
Click to hide internal directories.