|
12345678910111213141516171819202122232425262728 |
- 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(method string, apiKey string, param map[string]string) (string, error) {
- url := "http://8.130.97.197/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))
- }
|