package recharge import ( "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/comm" zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" "github.com/syyongx/php2go" "strings" ) func send(url, method string, apiKey string, param map[string]string) (string, error) { if url == "" { url = "http://szcz.jjffb.com/yrapi.php/" } url = url + method //url := "http://szcz.jjffb.com/yrapi.php/" + method param["sign"] = GetRechargeSign(apiKey, param) post, err := zhios_third_party_utils.CurlPost(url, param, map[string]string{}) return string(post), err } func GetRechargeSign(apiKey string, param map[string]string) string { str := "" keys := comm.KsortToStr(param) for _, k := range keys { if str != "" { str += "&" + k + "=" + param[k] } else { str += k + "=" + param[k] } } str += "&apikey=" + apiKey return strings.ToUpper(php2go.Md5(str)) }