| | |
| | | import com.nuvole.util.IdGenerator; |
| | | import com.nuvole.util.pay.allinPay.syb.param.MerchantAddParam; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpPost; |
| | |
| | | paramMap.put("version", version); |
| | | paramMap.put("authcode", authCode); |
| | | paramMap.put("authtype", authType); |
| | | if (StringUtils.isNotBlank(identify)) { |
| | | if (StrUtil.isNotBlank(identify)) { |
| | | paramMap.put("identify", identify); |
| | | } |
| | | if (StringUtils.isNotBlank(subAppid)) { |
| | | if (StrUtil.isNotBlank(subAppid)) { |
| | | paramMap.put("sub_appid", subAppid); |
| | | } |
| | | paramMap.put("randomstr", IdGenerator.getUUID()); |
| | |
| | | while (it.hasNext()) { |
| | | Map.Entry<String, String> en = it.next(); |
| | | String value = en.getValue(); |
| | | if (StringUtils.isBlank(value)) { |
| | | if (StrUtil.isBlank(value)) { |
| | | continue; |
| | | } |
| | | sf.append(en.getKey() + "=" + Convert.toStr(value) |
| | |
| | | paramMap.put("signtype", "RSA"); |
| | | paramMap.put("chnltype", chnltype); |
| | | |
| | | if (StringUtils.isNotBlank(pid)) { |
| | | if (StrUtil.isNotBlank(pid)) { |
| | | paramMap.put("pid", pid); |
| | | } |
| | | String signStr = coverMap2String(paramMap); |
| | |
| | | paramMap.put("randomstr", IdGenerator.getUUID()); |
| | | paramMap.put("signtype", "RSA"); |
| | | |
| | | if (StringUtils.isNotBlank(userid)) { |
| | | if (StrUtil.isNotBlank(userid)) { |
| | | paramMap.put("userid", userid); |
| | | } |
| | | if (StringUtils.isNotBlank(notifyurl)) { |
| | | if (StrUtil.isNotBlank(notifyurl)) { |
| | | paramMap.put("notifyurl", notifyurl); |
| | | } |
| | | if (StringUtils.isNotBlank(pagetype)) { |
| | | if (StrUtil.isNotBlank(pagetype)) { |
| | | paramMap.put("pagetype", pagetype); |
| | | } |
| | | |
| | |
| | | if (merchantAddParam == null) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getRandomstr())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getRandomstr())) { |
| | | merchantAddParam.setRandomstr(IdGenerator.getUUID()); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getSigntype())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getSigntype())) { |
| | | merchantAddParam.setSigntype("RSA"); |
| | | } |
| | | // *商户性质 |
| | | //1.企业 3.个体户 4.个人 6.事业单位 |
| | | String comproperty = merchantAddParam.getComproperty(); |
| | | if (StringUtils.isBlank(comproperty)) { |
| | | if (StrUtil.isBlank(comproperty)) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质需要填写"); |
| | | } |
| | | //商户性质为企业 |
| | | // if ("1".equals(comproperty)) { |
| | | // if (StringUtils.isBlank(merchantAddParam.getPubacctinfo())) { |
| | | // if (StrUtil.isBlank(merchantAddParam.getPubacctinfo())) { |
| | | // return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业时需要填写对公账户信息"); |
| | | // } |
| | | // } |
| | | //商户性质为个人时必填 |
| | | if ("4".equals(comproperty)) { |
| | | if (StringUtils.isBlank(merchantAddParam.getLegalpic())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getLegalpic())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质非个人时需要上传经营者手持身份证照片"); |
| | | } |
| | | } |
| | | if (!"4".equals(comproperty)) { |
| | | if (StringUtils.isBlank(merchantAddParam.getCorpbusname())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getCorpbusname())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质非个人时需要填写营业执照名称"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getCreditcode())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getCreditcode())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质非个人时需要填写统一社会信用代码证"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getCreditcodeexpire())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getCreditcodeexpire())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质非个人时需要填写社会信用代码证有效期"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getCorpbuspic())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getCorpbuspic())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质非个人时需要填写营业执照照片"); |
| | | } |
| | | |
| | | if (StringUtils.isBlank(merchantAddParam.getBusconactperson())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getBusconactperson())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质非个人时需要填写业务联系人姓名"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getBusconacttel())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getBusconacttel())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质非个人时需要填写业务联系人电话"); |
| | | } |
| | | } |
| | | |
| | | //商户性质为企业、个体户时必填 |
| | | if ("1".equals(comproperty) || "3".equals(comproperty)) { |
| | | if (StringUtils.isBlank(merchantAddParam.getHoldername())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getHoldername())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业、个体户时需要填写控股股东姓名"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getHolderidno())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getHolderidno())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业、个体户时需要填写控股股东身份证"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getHolderexpire())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getHolderexpire())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业、个体户时需要填写控股股东有效期"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getRegisterfund())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getRegisterfund())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业、个体户时需要填写注册资本"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getStafftotal())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getStafftotal())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业、个体户时需要填写员工人数"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getOperatelimit())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getOperatelimit())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业、个体户时需要填写经营区域"); |
| | | } |
| | | if (StringUtils.isBlank(merchantAddParam.getInspect())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getInspect())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "商户性质为企业、个体户时需要填写经营地段"); |
| | | } |
| | | |
| | | } |
| | | // if (StringUtils.isBlank(merchantAddParam.getAddfacusid())) { |
| | | // if (StrUtil.isBlank(merchantAddParam.getAddfacusid())) { |
| | | // return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "所在机构资金归集时,该字段不能为空"); |
| | | // } |
| | | |
| | | // 结算账户 0-对私 1-对公 |
| | | String accttype = merchantAddParam.getAccttype(); |
| | | if (StringUtils.isBlank(accttype)) { |
| | | if (StrUtil.isBlank(accttype)) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "结算账户类型不能为空"); |
| | | } |
| | | if ("0".equals(accttype)) { |
| | | if (StringUtils.isBlank(merchantAddParam.getSettidno())) { |
| | | if (StrUtil.isBlank(merchantAddParam.getSettidno())) { |
| | | return new CommonResult(CommonResultEmnu.INVALID_PARAMS, "结算账户对私时,结算人身份证号不能为空"); |
| | | } |
| | | } |