Browse Source

add Reverse: for v1.3.5

tags/v1.3.5
jiaoboxiang 2 years ago
parent
commit
f798272211
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      pay/pay_by_join.go

+ 4
- 4
pay/pay_by_join.go View File

@@ -9,7 +9,7 @@ import (
"strings" "strings"
) )


func UniPayByJoin(payParams *md.JoinPayReq, isPrd bool) (map[string]interface{}, error) {
func UniPayByJoin(payParams *md.JoinPayReq, paySecretKey string,isPrd bool) (map[string]interface{}, error) {
payParams.P0Version = "2.1" payParams.P0Version = "2.1"
//payParams.P1MerchantNo = md.PayTestAccount //payParams.P1MerchantNo = md.PayTestAccount
payParams.P4Cur = "1" payParams.P4Cur = "1"
@@ -24,7 +24,7 @@ func UniPayByJoin(payParams *md.JoinPayReq, isPrd bool) (map[string]interface{},
//商家报备编号(分微信和支付宝的);支付宝的://payParams.QATradeMerchantNo = md.PayTestAliAccount //商家报备编号(分微信和支付宝的);支付宝的://payParams.QATradeMerchantNo = md.PayTestAliAccount
//商家报备编号(分微信和支付宝的);微信的://payParams.QATradeMerchantNo = md.PayTestWeChatAccount //商家报备编号(分微信和支付宝的);微信的://payParams.QATradeMerchantNo = md.PayTestWeChatAccount
postData := url.Values{} postData := url.Values{}
creatHmac(payParams, &postData)
creatHmac(payParams,paySecretKey, &postData)
zhios_pay_utils.FilePutContents("UniPayByJoin", zhios_pay_utils.SerializeStr(map[string]interface{}{ zhios_pay_utils.FilePutContents("UniPayByJoin", zhios_pay_utils.SerializeStr(map[string]interface{}{
"data": payParams, "data": payParams,
})) }))
@@ -39,7 +39,7 @@ func UniPayByJoin(payParams *md.JoinPayReq, isPrd bool) (map[string]interface{},
return resp, err return resp, err
} }


func creatHmac(payParams *md.JoinPayReq, postData *url.Values) {
func creatHmac(payParams *md.JoinPayReq,paySecretKey string, postData *url.Values) {
hmac := "" hmac := ""
if payParams.P0Version != "" { if payParams.P0Version != "" {
postData.Add("p0_Version", payParams.P0Version) postData.Add("p0_Version", payParams.P0Version)
@@ -129,6 +129,6 @@ func creatHmac(payParams *md.JoinPayReq, postData *url.Values) {
postData.Add("ql_TerminalIp", payParams.QLTerminalIp) postData.Add("ql_TerminalIp", payParams.QLTerminalIp)
hmac = hmac + payParams.QLTerminalIp hmac = hmac + payParams.QLTerminalIp
} }
payParams.Hmac = zhios_pay_utils.Md5(hmac + md.PayTestSecretKey)
payParams.Hmac = zhios_pay_utils.Md5(hmac + paySecretKey)
postData.Add("hmac", payParams.Hmac) postData.Add("hmac", payParams.Hmac)
} }

Loading…
Cancel
Save