1
This commit is contained in:
@@ -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 {
|
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)
|
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)
|
oneMd5 := fmt.Sprintf("%x", md5.Sum([]byte(a.password))) + paramsSign + a.secret
|
||||||
return md5Password
|
//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) {
|
func (a *API) AccessAPI(baseUrl, actionApi, method string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
|
||||||
|
|||||||
11
platformapi/recharge_phone_bill/recharge_test.go
Normal file
11
platformapi/recharge_phone_bill/recharge_test.go
Normal file
@@ -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()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user