第三方api接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1234567891011121314151617181920212223242526272829303132
  1. package recharge
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/comm"
  4. zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
  5. "github.com/syyongx/php2go"
  6. "strings"
  7. )
  8. func send(url, method string, apiKey string, param map[string]string) (string, error) {
  9. if url == "" {
  10. url = "http://szcz.jjffb.com/yrapi.php/"
  11. }
  12. url = url + method
  13. //url := "http://szcz.jjffb.com/yrapi.php/" + method
  14. param["sign"] = GetRechargeSign(apiKey, param)
  15. post, err := zhios_third_party_utils.CurlPost(url, param, map[string]string{})
  16. return string(post), err
  17. }
  18. func GetRechargeSign(apiKey string, param map[string]string) string {
  19. str := ""
  20. keys := comm.KsortToStr(param)
  21. for _, k := range keys {
  22. if str != "" {
  23. str += "&" + k + "=" + param[k]
  24. } else {
  25. str += k + "=" + param[k]
  26. }
  27. }
  28. str += "&apikey=" + apiKey
  29. return strings.ToUpper(php2go.Md5(str))
  30. }