This commit is contained in:
邹宗楠
2022-11-25 14:22:08 +08:00
parent 7951af8df8
commit fec6d9a19e

View File

@@ -38,7 +38,7 @@ func New(password, account, secret string, config ...*platformapi.APIConfig) *AP
// 大写( md5( md5(密码)+手机号码+产品编码+商户订单号+秘钥 ) ) 话费充值签名接口
func (a *API) signParam(params map[string]interface{}) (sig string) {
paramsSign := ""
if params["mobile"] != "" && params["flowCode"] != "" && params["orderNumber"] != "" {
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)