Documentation ¶
Overview ¶
Package option 微信支付api v3 go http-client Option选项
Index ¶
- type ClientOption
- func WithCredential(credential auth.Credential) ClientOption
- func WithHTTPClient(client *http.Client) ClientOption
- func WithMerchant(mchID, certificateSerialNo string, privateKey *rsa.PrivateKey) ClientOption
- func WithTimeout(timeout time.Duration) ClientOption
- func WithValidator(validator auth.Validator) ClientOption
- func WithWechatPay(certificateList []*x509.Certificate) ClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientOption ¶
type ClientOption interface {
Apply(settings *setting.DialSettings)
}
ClientOption 一个ClientOption可以作为微信支付api v3 client的配置
func WithCredential ¶
func WithCredential(credential auth.Credential) ClientOption
WithCredential 返回一个指定credential的ClientOption,用于生成http request header 中authorization信息
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient 返回一个指定网络通信为HttpClient的ClientOption,指定后使用用户自动创建的的http.client,如果用户不创建,则帮助用户 创建一个默认的http.client
func WithMerchant ¶
func WithMerchant(mchID, certificateSerialNo string, privateKey *rsa.PrivateKey) ClientOption
WithMerchant 通过商户号、商户证书序列号、私钥构建一个默认的credential的ClientOption,用于生成http request header 中authorization信息
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout 返回一个指定超时时间的ClientOption
func WithValidator ¶
func WithValidator(validator auth.Validator) ClientOption
WithCredential 返回一个指定validator的ClientOption,用于校验http response header
func WithWechatPay ¶
func WithWechatPay(certificateList []*x509.Certificate) ClientOption
WithWechatPay 设置微信支付平台证书信息,返回一个指定validator的ClientOption,用于校验http response header
Click to show internal directories.
Click to hide internal directories.