初始化SDK配置(initWithAppID)
输入
/**
*
*@param AppId app识别号
*@param isShowSuccessPageStr 是否显示开户成功页面 “true”显示,“flase”不显示
*@param appUserId 用户ID
*@param merchantId 商户号 如无传入null
*@param loginSign 加签
*@param random 随机数
*@param context 当前activity的context
*/
HRSDK.initWithAppID(String appId, String isShowSuccessPageStr,String appUserId,String merchantId,String loginSign, String random, Context context, HRResponse response)
加签方式(建议由服务端加签。防止secretKey泄漏)
public static String signLogin(String appID, String random, String secretKey) {
StringBuffer buffer = new StringBuffer();
buffer.append("appID=" + appID + "&");
buffer.append("random=" + random + "&");
buffer.append("key=" + secretKey);
return getMD5(buffer.toString()).toUpperCase();
}
输出
HRResponse response = new HRResponse() {
@Override
public void response(Object obj) {
Map resultMap = (Map)ojb;
//结果代码 String 正常为全0,出错时为错误码
resultMap.get("returnCode");
//结果信息 String 正常为空字符串,出错时为错误信息
resultMap.get("returnMsg");
//错误代码 String 正常为全0,出错时为错误码
resultMap.get("errorCode");
//错误信息 String 正常为空字符串,出错时为错误信息
resultMap.get("errorMsg");
}
};