diff --git a/platformapi/recharge_phone_bill/recharge_api.go b/platformapi/recharge_phone_bill/recharge_api.go index e9f2ab31..c72dd9f1 100644 --- a/platformapi/recharge_phone_bill/recharge_api.go +++ b/platformapi/recharge_phone_bill/recharge_api.go @@ -41,8 +41,9 @@ func (a *API) signParam(params map[string]interface{}) (sig string) { if params["mobile"] != "" && params["flowCode"] != "" && params["orderNumber"] != "" && params["mobile"] != nil && params["flowCode"] != nil && params["orderNumber"] != nil { paramsSign = params["mobile"].(string) + params["flowCode"].(string) + params["orderNumber"].(string) } - md5Password := fmt.Sprintf("%X", fmt.Sprintf("%X", md5.Sum([]byte(a.password)))+paramsSign+a.secret) - return md5Password + oneMd5 := fmt.Sprintf("%x", md5.Sum([]byte(a.password))) + paramsSign + a.secret + //twoMd5 := strings.ToUpper(fmt.Sprintf("%X", md5.Sum([]byte(oneMd5)))) + return strings.ToUpper(fmt.Sprintf("%x", md5.Sum([]byte(oneMd5)))) } func (a *API) AccessAPI(baseUrl, actionApi, method string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) { diff --git a/platformapi/recharge_phone_bill/recharge_test.go b/platformapi/recharge_phone_bill/recharge_test.go new file mode 100644 index 00000000..86becabc --- /dev/null +++ b/platformapi/recharge_phone_bill/recharge_test.go @@ -0,0 +1,11 @@ +package recharge_phone_bill + +import "testing" + +//AccountNo = "cdrxqgmc" +//PasswordNo = "cdrxqgmc1234" +//PhoneScenery = "cdrxqgmc123456" +func TestQueryAccountBill(t *testing.T) { + a := New("cdrxqgmc1234", "cdrxqgmc", "cdrxqgmc123456") + a.QueryAccountBill() +}