diff --git a/pay/pay_by_join.go b/pay/pay_by_join.go index 2a1d58d..490c96f 100644 --- a/pay/pay_by_join.go +++ b/pay/pay_by_join.go @@ -10,10 +10,11 @@ import ( "strings" ) -func UniPayByJoin(payParams *md.JoinPayReq, paySecretKey string,isPrd bool) (*md.JoinPayResponse, error) { +func UniPayByJoin(payParams *md.JoinPayReq, paySecretKey string, isPrd bool) (*md.JoinPayResponse, error) { payParams.P0Version = "2.1" - //payParams.P1MerchantNo = md.PayTestAccount payParams.P4Cur = "1" + //可注释行: + //payParams.P1MerchantNo = md.PayTestAccount //payParams.P2OrderNo = "95271" //payParams.P3Amount = "0.1" //payParams.P5ProductName = "测试商品" @@ -29,13 +30,14 @@ func UniPayByJoin(payParams *md.JoinPayReq, paySecretKey string,isPrd bool) (*md //payParams.QATradeMerchantNo = md.PayTestAliAccount //商家报备编号(分微信和支付宝的);微信的: //payParams.QATradeMerchantNo = md.PayTestWeChatAccount + //不可注释行: postData := url.Values{} - creatHmac(payParams,paySecretKey, &postData) + creatHmac(payParams, paySecretKey, &postData) zhios_pay_utils.FilePutContents("UniPayByJoin", zhios_pay_utils.SerializeStr(map[string]interface{}{ "data": payParams, })) tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } client := &http.Client{Transport: tr} response, err := client.Post(md.JoinPayUrl, "application/x-www-form-urlencoded", strings.NewReader(postData.Encode())) @@ -49,7 +51,7 @@ func UniPayByJoin(payParams *md.JoinPayReq, paySecretKey string,isPrd bool) (*md return &resp, err } -func creatHmac(payParams *md.JoinPayReq,paySecretKey string, postData *url.Values) { +func creatHmac(payParams *md.JoinPayReq, paySecretKey string, postData *url.Values) { hmac := "" if payParams.P0Version != "" { postData.Add("p0_Version", payParams.P0Version)