|
@@ -6,6 +6,7 @@ import ( |
|
|
"crypto/hmac" |
|
|
"crypto/hmac" |
|
|
"crypto/sha256" |
|
|
"crypto/sha256" |
|
|
"encoding/hex" |
|
|
"encoding/hex" |
|
|
|
|
|
"fmt" |
|
|
"github.com/syyongx/php2go" |
|
|
"github.com/syyongx/php2go" |
|
|
"strings" |
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
@@ -20,7 +21,7 @@ func Send(appkey, appSecret, method string, params map[string]interface{}, accto |
|
|
"app_key": appkey, |
|
|
"app_key": appkey, |
|
|
"method": method, |
|
|
"method": method, |
|
|
"param_json": paramJson, |
|
|
"param_json": paramJson, |
|
|
"timestamp": zhios_third_party_utils.Int64ToStr(time.Now().Unix()), |
|
|
|
|
|
|
|
|
"timestamp": time.Now().Format("2006-01-02 15:04:05"), |
|
|
"v": "2", |
|
|
"v": "2", |
|
|
} |
|
|
} |
|
|
sign := GetSign(appSecret, param) |
|
|
sign := GetSign(appSecret, param) |
|
@@ -36,6 +37,8 @@ func Send(appkey, appSecret, method string, params map[string]interface{}, accto |
|
|
url += "?" + k + "=" + php2go.URLEncode(v) |
|
|
url += "?" + k + "=" + php2go.URLEncode(v) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
fmt.Println(url) |
|
|
|
|
|
fmt.Println(paramJson) |
|
|
data, err := zhios_third_party_utils.CurlPost(url, paramJson, nil) |
|
|
data, err := zhios_third_party_utils.CurlPost(url, paramJson, nil) |
|
|
return string(data), err |
|
|
return string(data), err |
|
|
} |
|
|
} |
|
|