瀏覽代碼

add Reverse: for v1.3.5

tags/v1.3.5
jiaoboxiang 2 年之前
父節點
當前提交
f798272211
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. +4
    -4
      pay/pay_by_join.go

+ 4
- 4
pay/pay_by_join.go 查看文件

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

func creatHmac(payParams *md.JoinPayReq, postData *url.Values) {
func creatHmac(payParams *md.JoinPayReq,paySecretKey string, postData *url.Values) {
hmac := ""
if 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)
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)
}

Loading…
取消
儲存