Documentation ¶
Index ¶
- Variables
- func InitAliAppClient(c *AliAppClient)
- func InitAliWebClient(c *AliWebClient)
- func InitWechatClient(c *WechatAppClient)
- type AliAppClient
- type AliWebClient
- func (ac *AliWebClient) CheckSign(signData, sign string) error
- func (ac *AliWebClient) GenSign(m map[string]string) (string, error)
- func (ac *AliWebClient) Pay(charge *common.Charge) (string, error)
- func (ac *AliWebClient) ToHTML(m map[string]string) string
- func (ac *AliWebClient) ToURL(m map[string]string) string
- type HTTPClient
- type HTTPSClient
- type WechatAppClient
- type WechatWebClient
- func (wechat *WechatWebClient) CheckSign(data string, sign string) error
- func (wechat *WechatWebClient) GenSign(m map[string]string) (string, error)
- func (wechat *WechatWebClient) Pay(charge *common.Charge) (string, error)
- func (wechat *WechatWebClient) QueryOrder(tradeNum string) (*common.WeChatQueryResult, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HTTPC *HTTPClient HTTPSC *HTTPSClient )
Functions ¶
func InitAliAppClient ¶
func InitAliAppClient(c *AliAppClient)
func InitAliWebClient ¶
func InitAliWebClient(c *AliWebClient)
func InitWechatClient ¶
func InitWechatClient(c *WechatAppClient)
Types ¶
type AliAppClient ¶
type AliAppClient struct { PartnerID string //合作者ID SellerID string AppID string // 应用ID PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey }
func DefaultAliAppClient ¶
func DefaultAliAppClient() *AliAppClient
DefaultAliAppClient 得到默认支付宝app客户端
func (*AliAppClient) CheckSign ¶
func (aa *AliAppClient) CheckSign(data string, sign string) error
CheckSign 检测签名
type AliWebClient ¶
type AliWebClient struct { PartnerID string // 支付宝合作身份ID SellerID string // 卖家支付宝用户号 AppID string // 支付宝分配给开发者的应用ID ps: 查询订单用 CallbackURL string // 回调接口 PrivateKey *rsa.PrivateKey // 私钥 PublicKey *rsa.PublicKey // 公钥 PayURL string // 支付网管地址 }
AliWebClient 支付宝网页支付
func DefaultAliWebClient ¶
func DefaultAliWebClient() *AliWebClient
DefaultAliWebClient 默认支付宝网页支付客户端
func (*AliWebClient) CheckSign ¶
func (ac *AliWebClient) CheckSign(signData, sign string) error
CheckSign 检测签名
func (*AliWebClient) GenSign ¶
func (ac *AliWebClient) GenSign(m map[string]string) (string, error)
GenSign 产生签名
func (*AliWebClient) Pay ¶
func (ac *AliWebClient) Pay(charge *common.Charge) (string, error)
Pay 实现支付接口
type HTTPClient ¶
HTTPClient http客户端
type HTTPSClient ¶
HTTPSClient HTTPS客户端结构
type WechatAppClient ¶
type WechatAppClient struct { AppID string // AppID MchID string // 商户号ID Key string // 密钥 PayURL string // 支付地址 // contains filtered or unexported fields }
WechatAppClient 微信app支付
func DefaultWechatAppClient ¶
func DefaultWechatAppClient() *WechatAppClient
DefaultWechatAppClient 默认微信app客户端
func (*WechatAppClient) CheckSign ¶
func (wechat *WechatAppClient) CheckSign(data string, sign string) error
CheckSign 检查签名
type WechatWebClient ¶
type WechatWebClient struct { AppID string // 公众账号ID MchID string // 商户号ID CallbackURL string // 回调地址 Key string // 密钥 PayURL string // 支付地址 QueryURL string // 查询地址 }
WechatWebClient 微信公众号支付
func DefaultWechatWebClient ¶
func DefaultWechatWebClient() *WechatWebClient
func (*WechatWebClient) CheckSign ¶
func (wechat *WechatWebClient) CheckSign(data string, sign string) error
CheckSign 检查签名
func (*WechatWebClient) GenSign ¶
func (wechat *WechatWebClient) GenSign(m map[string]string) (string, error)
GenSign 产生签名
func (*WechatWebClient) Pay ¶
func (wechat *WechatWebClient) Pay(charge *common.Charge) (string, error)
Pay 支付
func (*WechatWebClient) QueryOrder ¶
func (wechat *WechatWebClient) QueryOrder(tradeNum string) (*common.WeChatQueryResult, error)
QueryOrder 查询订单
Click to show internal directories.
Click to hide internal directories.