Explorar o código

Client change to public

Jerry %!s(int64=6) %!d(string=hai) anos
pai
achega
2f568b3598
Modificáronse 4 ficheiros con 46 adicións e 46 borrados
  1. 22 22
      alipay_client.go
  2. 8 8
      alipay_params.go
  3. 15 15
      wechat_client.go
  4. 1 1
      wechat_params.go

+ 22 - 22
alipay_client.go

@@ -9,7 +9,7 @@ import (
 	"time"
 )
 
-type aliPayClient struct {
+type AliPayClient struct {
 	AppId            string
 	privateKey       string
 	AlipayRootCertSN string
@@ -28,8 +28,8 @@ type aliPayClient struct {
 //    appId:应用ID
 //    privateKey:应用私钥
 //    isProd:是否是正式环境
-func NewAliPayClient(appId, privateKey string, isProd bool) (client *aliPayClient) {
-	client = new(aliPayClient)
+func NewAliPayClient(appId, privateKey string, isProd bool) (client *AliPayClient) {
+	client = new(AliPayClient)
 	client.AppId = appId
 	client.privateKey = privateKey
 	client.isProd = isProd
@@ -38,7 +38,7 @@ func NewAliPayClient(appId, privateKey string, isProd bool) (client *aliPayClien
 
 //alipay.trade.fastpay.refund.query(统一收单交易退款查询)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.fastpay.refund.query
-func (this *aliPayClient) AliPayTradeFastPayRefundQuery(body BodyMap) (aliRsp *AliPayTradeFastpayRefundQueryResponse, err error) {
+func (this *AliPayClient) AliPayTradeFastPayRefundQuery(body BodyMap) (aliRsp *AliPayTradeFastpayRefundQueryResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	trade2 := body.Get("trade_no")
@@ -65,7 +65,7 @@ func (this *aliPayClient) AliPayTradeFastPayRefundQuery(body BodyMap) (aliRsp *A
 
 //alipay.trade.order.settle(统一收单交易结算接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.order.settle
-func (this *aliPayClient) AliPayTradeOrderSettle(body BodyMap) (aliRsp *AliPayTradeOrderSettleResponse, err error) {
+func (this *AliPayClient) AliPayTradeOrderSettle(body BodyMap) (aliRsp *AliPayTradeOrderSettleResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_request_no")
 	trade2 := body.Get("trade_no")
@@ -92,7 +92,7 @@ func (this *aliPayClient) AliPayTradeOrderSettle(body BodyMap) (aliRsp *AliPayTr
 
 //alipay.trade.create(统一收单交易创建接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.create
-func (this *aliPayClient) AliPayTradeCreate(body BodyMap) (aliRsp *AliPayTradeCreateResponse, err error) {
+func (this *AliPayClient) AliPayTradeCreate(body BodyMap) (aliRsp *AliPayTradeCreateResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	trade2 := body.Get("buyer_id")
@@ -119,7 +119,7 @@ func (this *aliPayClient) AliPayTradeCreate(body BodyMap) (aliRsp *AliPayTradeCr
 
 //alipay.trade.close(统一收单交易关闭接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.close
-func (this *aliPayClient) AliPayTradeClose(body BodyMap) (aliRsp *AliPayTradeCloseResponse, err error) {
+func (this *AliPayClient) AliPayTradeClose(body BodyMap) (aliRsp *AliPayTradeCloseResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	trade2 := body.Get("trade_no")
@@ -146,7 +146,7 @@ func (this *aliPayClient) AliPayTradeClose(body BodyMap) (aliRsp *AliPayTradeClo
 
 //alipay.trade.cancel(统一收单交易撤销接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.cancel
-func (this *aliPayClient) AliPayTradeCancel(body BodyMap) (aliRsp *AliPayTradeCancelResponse, err error) {
+func (this *AliPayClient) AliPayTradeCancel(body BodyMap) (aliRsp *AliPayTradeCancelResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	trade2 := body.Get("trade_no")
@@ -173,7 +173,7 @@ func (this *aliPayClient) AliPayTradeCancel(body BodyMap) (aliRsp *AliPayTradeCa
 
 //alipay.trade.refund(统一收单交易退款接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.refund
-func (this *aliPayClient) AliPayTradeRefund(body BodyMap) (aliRsp *AliPayTradeRefundResponse, err error) {
+func (this *AliPayClient) AliPayTradeRefund(body BodyMap) (aliRsp *AliPayTradeRefundResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	trade2 := body.Get("trade_no")
@@ -200,7 +200,7 @@ func (this *aliPayClient) AliPayTradeRefund(body BodyMap) (aliRsp *AliPayTradeRe
 
 //alipay.trade.refund(统一收单退款页面接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.page.refund
-func (this *aliPayClient) AliPayTradePageRefund(body BodyMap) (aliRsp *AliPayTradePageRefundResponse, err error) {
+func (this *AliPayClient) AliPayTradePageRefund(body BodyMap) (aliRsp *AliPayTradePageRefundResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	trade2 := body.Get("trade_no")
@@ -227,7 +227,7 @@ func (this *aliPayClient) AliPayTradePageRefund(body BodyMap) (aliRsp *AliPayTra
 
 //alipay.trade.precreate(统一收单线下交易预创建)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.precreate
-func (this *aliPayClient) AliPayTradePrecreate(body BodyMap) (aliRsp *AlipayTradePrecreateResponse, err error) {
+func (this *AliPayClient) AliPayTradePrecreate(body BodyMap) (aliRsp *AlipayTradePrecreateResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	if trade1 == null {
@@ -253,7 +253,7 @@ func (this *aliPayClient) AliPayTradePrecreate(body BodyMap) (aliRsp *AlipayTrad
 
 //alipay.trade.pay(统一收单交易支付接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.pay
-func (this *aliPayClient) AliPayTradePay(body BodyMap) (aliRsp *AliPayTradePayResponse, err error) {
+func (this *AliPayClient) AliPayTradePay(body BodyMap) (aliRsp *AliPayTradePayResponse, err error) {
 	var bytes []byte
 	trade := body.Get("out_trade_no")
 	if trade == null {
@@ -282,7 +282,7 @@ func (this *aliPayClient) AliPayTradePay(body BodyMap) (aliRsp *AliPayTradePayRe
 
 //alipay.trade.query(统一收单线下交易查询)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.query
-func (this *aliPayClient) AliPayTradeQuery(body BodyMap) (aliRsp *AliPayTradeQueryResponse, err error) {
+func (this *AliPayClient) AliPayTradeQuery(body BodyMap) (aliRsp *AliPayTradeQueryResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_trade_no")
 	trade2 := body.Get("trade_no")
@@ -309,7 +309,7 @@ func (this *aliPayClient) AliPayTradeQuery(body BodyMap) (aliRsp *AliPayTradeQue
 
 //alipay.trade.app.pay(app支付接口2.0)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.app.pay
-func (this *aliPayClient) AliPayTradeAppPay(body BodyMap) (payParam string, err error) {
+func (this *AliPayClient) AliPayTradeAppPay(body BodyMap) (payParam string, err error) {
 	var bytes []byte
 	trade := body.Get("out_trade_no")
 	if trade == null {
@@ -327,7 +327,7 @@ func (this *aliPayClient) AliPayTradeAppPay(body BodyMap) (payParam string, err
 
 //alipay.trade.wap.pay(手机网站支付接口2.0)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.wap.pay
-func (this *aliPayClient) AliPayTradeWapPay(body BodyMap) (payUrl string, err error) {
+func (this *AliPayClient) AliPayTradeWapPay(body BodyMap) (payUrl string, err error) {
 	var bytes []byte
 	trade := body.Get("out_trade_no")
 	if trade == null {
@@ -346,7 +346,7 @@ func (this *aliPayClient) AliPayTradeWapPay(body BodyMap) (payUrl string, err er
 
 //alipay.trade.page.pay(统一收单下单并支付页面接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.page.pay
-func (this *aliPayClient) AliPayTradePagePay(body BodyMap) (payUrl string, err error) {
+func (this *AliPayClient) AliPayTradePagePay(body BodyMap) (payUrl string, err error) {
 	var bytes []byte
 	trade := body.Get("out_trade_no")
 	if trade == null {
@@ -365,7 +365,7 @@ func (this *aliPayClient) AliPayTradePagePay(body BodyMap) (payUrl string, err e
 
 //alipay.fund.trans.toaccount.transfer(单笔转账到支付宝账户接口)
 //    文档地址:https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer
-func (this *aliPayClient) AlipayFundTransToaccountTransfer(body BodyMap) (aliRsp *AlipayFundTransToaccountTransferResponse, err error) {
+func (this *AliPayClient) AlipayFundTransToaccountTransfer(body BodyMap) (aliRsp *AlipayFundTransToaccountTransferResponse, err error) {
 	var bytes []byte
 	trade1 := body.Get("out_biz_no")
 	if trade1 == null {
@@ -391,13 +391,13 @@ func (this *aliPayClient) AlipayFundTransToaccountTransfer(body BodyMap) (aliRsp
 
 //alipay.trade.orderinfo.sync(支付宝订单信息同步接口)
 //    文档地址:https://docs.open.alipay.com/api_1/alipay.trade.orderinfo.sync
-func (this *aliPayClient) AliPayTradeOrderinfoSync(body BodyMap) {
+func (this *AliPayClient) AliPayTradeOrderinfoSync(body BodyMap) {
 
 }
 
 //alipay.system.oauth.token(换取授权访问令牌)
 //    文档地址:https://docs.open.alipay.com/api_9/alipay.system.oauth.token
-func (this *aliPayClient) AliPaySystemOauthToken(body BodyMap) (aliRsp *AliPaySystemOauthTokenResponse, err error) {
+func (this *AliPayClient) AliPaySystemOauthToken(body BodyMap) (aliRsp *AliPaySystemOauthTokenResponse, err error) {
 	var bytes []byte
 	grantType := body.Get("grant_type")
 	if grantType == null {
@@ -429,7 +429,7 @@ func (this *aliPayClient) AliPaySystemOauthToken(body BodyMap) (aliRsp *AliPaySy
 
 //alipay.open.auth.token.app(换取应用授权令牌)
 //    文档地址:https://docs.open.alipay.com/api_9/alipay.open.auth.token.app
-func (this *aliPayClient) AlipayOpenAuthTokenApp(body BodyMap) (aliRsp *AlipayOpenAuthTokenAppResponse, err error) {
+func (this *AliPayClient) AlipayOpenAuthTokenApp(body BodyMap) (aliRsp *AlipayOpenAuthTokenAppResponse, err error) {
 	var bs []byte
 	grantType := body.Get("grant_type")
 	if grantType == null {
@@ -462,7 +462,7 @@ func (this *aliPayClient) AlipayOpenAuthTokenApp(body BodyMap) (aliRsp *AlipayOp
 
 //zhima.credit.score.get(芝麻分)
 //    文档地址:https://docs.open.alipay.com/api_8/zhima.credit.score.get
-func (this *aliPayClient) ZhimaCreditScoreGet(body BodyMap) (aliRsp *ZhimaCreditScoreGetResponse, err error) {
+func (this *AliPayClient) ZhimaCreditScoreGet(body BodyMap) (aliRsp *ZhimaCreditScoreGetResponse, err error) {
 	var bytes []byte
 
 	trade1 := body.Get("product_code")
@@ -492,7 +492,7 @@ func (this *aliPayClient) ZhimaCreditScoreGet(body BodyMap) (aliRsp *ZhimaCredit
 }
 
 //向支付宝发送请求
-func (this *aliPayClient) doAliPay(body BodyMap, method string) (bytes []byte, err error) {
+func (this *AliPayClient) doAliPay(body BodyMap, method string) (bytes []byte, err error) {
 	//===============转换body参数===================
 	bodyStr, err := json.Marshal(body)
 	if err != nil {

+ 8 - 8
alipay_params.go

@@ -38,32 +38,32 @@ type OpenApiRoyaltyDetailInfoPojo struct {
 
 //设置 应用公钥证书SN
 //    appCertSN:应用公钥证书SN,通过 gopay.GetCertSN() 获取
-func (this *aliPayClient) SetAppCertSN(appCertSN string) (client *aliPayClient) {
+func (this *AliPayClient) SetAppCertSN(appCertSN string) (client *AliPayClient) {
 	this.AppCertSN = appCertSN
 	return this
 }
 
 //设置 支付宝根证书SN
 //    alipayRootCertSN:支付宝根证书SN,通过 gopay.GetCertSN() 获取
-func (this *aliPayClient) SetAliPayRootCertSN(alipayRootCertSN string) (client *aliPayClient) {
+func (this *AliPayClient) SetAliPayRootCertSN(alipayRootCertSN string) (client *AliPayClient) {
 	this.AlipayRootCertSN = alipayRootCertSN
 	return this
 }
 
 //设置支付后的ReturnUrl
-func (this *aliPayClient) SetReturnUrl(url string) (client *aliPayClient) {
+func (this *AliPayClient) SetReturnUrl(url string) (client *AliPayClient) {
 	this.ReturnUrl = url
 	return this
 }
 
 //设置支付宝服务器主动通知商户服务器里指定的页面http/https路径。
-func (this *aliPayClient) SetNotifyUrl(url string) (client *aliPayClient) {
+func (this *AliPayClient) SetNotifyUrl(url string) (client *AliPayClient) {
 	this.NotifyUrl = url
 	return this
 }
 
 //设置编码格式,如utf-8,gbk,gb2312等,默认推荐使用 utf-8
-func (this *aliPayClient) SetCharset(charset string) (client *aliPayClient) {
+func (this *AliPayClient) SetCharset(charset string) (client *AliPayClient) {
 	if charset == null {
 		this.Charset = "utf-8"
 	} else {
@@ -73,7 +73,7 @@ func (this *aliPayClient) SetCharset(charset string) (client *aliPayClient) {
 }
 
 //设置签名算法类型,目前支持RSA2和RSA,默认推荐使用 RSA2
-func (this *aliPayClient) SetSignType(signType string) (client *aliPayClient) {
+func (this *AliPayClient) SetSignType(signType string) (client *AliPayClient) {
 	if signType == null {
 		this.SignType = "RSA2"
 	} else {
@@ -83,13 +83,13 @@ func (this *aliPayClient) SetSignType(signType string) (client *aliPayClient) {
 }
 
 //设置应用授权
-func (this *aliPayClient) SetAppAuthToken(appAuthToken string) (client *aliPayClient) {
+func (this *AliPayClient) SetAppAuthToken(appAuthToken string) (client *AliPayClient) {
 	this.AppAuthToken = appAuthToken
 	return this
 }
 
 //设置用户信息授权
-func (this *aliPayClient) SetAuthToken(authToken string) (client *aliPayClient) {
+func (this *AliPayClient) SetAuthToken(authToken string) (client *AliPayClient) {
 	this.AuthToken = authToken
 	return this
 }

+ 15 - 15
wechat_client.go

@@ -10,7 +10,7 @@ import (
 	"strings"
 )
 
-type weChatClient struct {
+type WeChatClient struct {
 	AppId   string
 	MchId   string
 	apiKey  string
@@ -23,8 +23,8 @@ type weChatClient struct {
 //    mchId:商户ID
 //    apiKey:API秘钥值
 //    isProd:是否是正式环境
-func NewWeChatClient(appId, mchId, apiKey string, isProd bool) (client *weChatClient) {
-	client = new(weChatClient)
+func NewWeChatClient(appId, mchId, apiKey string, isProd bool) (client *WeChatClient) {
+	client = new(WeChatClient)
 	client.AppId = appId
 	client.MchId = mchId
 	client.apiKey = apiKey
@@ -34,7 +34,7 @@ func NewWeChatClient(appId, mchId, apiKey string, isProd bool) (client *weChatCl
 
 //提交付款码支付 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=9_10&index=1
-func (this *weChatClient) Micropay(body BodyMap) (wxRsp *WeChatMicropayResponse, err error) {
+func (this *WeChatClient) Micropay(body BodyMap) (wxRsp *WeChatMicropayResponse, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -59,7 +59,7 @@ func (this *weChatClient) Micropay(body BodyMap) (wxRsp *WeChatMicropayResponse,
 
 //统一下单 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
-func (this *weChatClient) UnifiedOrder(body BodyMap) (wxRsp *WeChatUnifiedOrderResponse, err error) {
+func (this *WeChatClient) UnifiedOrder(body BodyMap) (wxRsp *WeChatUnifiedOrderResponse, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -87,7 +87,7 @@ func (this *weChatClient) UnifiedOrder(body BodyMap) (wxRsp *WeChatUnifiedOrderR
 
 //查询订单 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_2
-func (this *weChatClient) QueryOrder(body BodyMap) (wxRsp *WeChatQueryOrderResponse, err error) {
+func (this *WeChatClient) QueryOrder(body BodyMap) (wxRsp *WeChatQueryOrderResponse, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -112,7 +112,7 @@ func (this *weChatClient) QueryOrder(body BodyMap) (wxRsp *WeChatQueryOrderRespo
 
 //关闭订单 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_3
-func (this *weChatClient) CloseOrder(body BodyMap) (wxRsp *WeChatCloseOrderResponse, err error) {
+func (this *WeChatClient) CloseOrder(body BodyMap) (wxRsp *WeChatCloseOrderResponse, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -137,7 +137,7 @@ func (this *weChatClient) CloseOrder(body BodyMap) (wxRsp *WeChatCloseOrderRespo
 
 //撤销订单 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=9_11&index=3
-func (this *weChatClient) Reverse(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp *WeChatReverseResponse, err error) {
+func (this *WeChatClient) Reverse(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp *WeChatReverseResponse, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -177,7 +177,7 @@ func (this *weChatClient) Reverse(body BodyMap, certFilePath, keyFilePath, pkcs1
 
 //申请退款 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_4
-func (this *weChatClient) Refund(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp *WeChatRefundResponse, err error) {
+func (this *WeChatClient) Refund(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp *WeChatRefundResponse, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -217,7 +217,7 @@ func (this *weChatClient) Refund(body BodyMap, certFilePath, keyFilePath, pkcs12
 
 //查询退款 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_5
-func (this *weChatClient) QueryRefund(body BodyMap) (wxRsp *WeChatQueryRefundResponse, err error) {
+func (this *WeChatClient) QueryRefund(body BodyMap) (wxRsp *WeChatQueryRefundResponse, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -242,7 +242,7 @@ func (this *weChatClient) QueryRefund(body BodyMap) (wxRsp *WeChatQueryRefundRes
 
 //下载对账单 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_6
-func (this *weChatClient) DownloadBill(body BodyMap) (wxRsp string, err error) {
+func (this *WeChatClient) DownloadBill(body BodyMap) (wxRsp string, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -260,7 +260,7 @@ func (this *weChatClient) DownloadBill(body BodyMap) (wxRsp string, err error) {
 //下载资金账单 ok
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_18&index=7
 //    好像不支持沙箱环境,因为沙箱环境默认需要用MD5签名,但是此接口仅支持HMAC-SHA256签名
-func (this *weChatClient) DownloadFundFlow(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp string, err error) {
+func (this *WeChatClient) DownloadFundFlow(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp string, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -294,7 +294,7 @@ func (this *weChatClient) DownloadFundFlow(body BodyMap, certFilePath, keyFilePa
 //拉取订单评价数据
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_17&index=11
 //    好像不支持沙箱环境,因为沙箱环境默认需要用MD5签名,但是此接口仅支持HMAC-SHA256签名
-func (this *weChatClient) BatchQueryComment(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp string, err error) {
+func (this *WeChatClient) BatchQueryComment(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp string, err error) {
 	var bytes []byte
 	if this.isProd {
 		//正式环境
@@ -331,7 +331,7 @@ func (this *weChatClient) BatchQueryComment(body BodyMap, certFilePath, keyFileP
 //企业向微信用户个人付款
 //    文档地址:https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_1
 //    注意:此方法未支持沙箱环境,默认正式环境,转账请慎重
-func (this *weChatClient) Transfer(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp *WeChatTransfersResponse, err error) {
+func (this *WeChatClient) Transfer(body BodyMap, certFilePath, keyFilePath, pkcs12FilePath string) (wxRsp *WeChatTransfersResponse, err error) {
 	var bytes []byte
 	var sign string
 	body.Set("mch_appid", this.AppId)
@@ -385,7 +385,7 @@ func (this *weChatClient) Transfer(body BodyMap, certFilePath, keyFilePath, pkcs
 }
 
 //向微信发送请求 ok
-func (this *weChatClient) doWeChat(body BodyMap, path string, tlsConfig ...*tls.Config) (bytes []byte, err error) {
+func (this *WeChatClient) doWeChat(body BodyMap, path string, tlsConfig ...*tls.Config) (bytes []byte, err error) {
 	var sign string
 	body.Set("appid", this.AppId)
 	body.Set("mch_id", this.MchId)

+ 1 - 1
wechat_params.go

@@ -15,7 +15,7 @@ type Country int
 //设置支付国家(默认:中国国内)
 //    根据支付地区情况设置国家
 //    country:<China:中国国内,China2:中国国内(冗灾方案),SoutheastAsia:东南亚,Other:其他国家>
-func (this *weChatClient) SetCountry(country Country) (client *weChatClient) {
+func (this *WeChatClient) SetCountry(country Country) (client *WeChatClient) {
 	switch country {
 	case China:
 		this.baseURL = wx_base_url_ch