提交 975f1eea 编写于 作者: terrfly's avatar terrfly

优化商户获取渠道用户API

上级 90be6ce8
...@@ -20,12 +20,14 @@ import com.alibaba.fastjson.JSONObject; ...@@ -20,12 +20,14 @@ import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.constants.CS; import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.exception.BizException; import com.jeequan.jeepay.core.exception.BizException;
import com.jeequan.jeepay.core.utils.JeepayKit; import com.jeequan.jeepay.core.utils.JeepayKit;
import com.jeequan.jeepay.core.utils.JsonKit;
import com.jeequan.jeepay.core.utils.SpringBeansUtil; import com.jeequan.jeepay.core.utils.SpringBeansUtil;
import com.jeequan.jeepay.core.utils.StringKit;
import com.jeequan.jeepay.pay.channel.IChannelUserService; import com.jeequan.jeepay.pay.channel.IChannelUserService;
import com.jeequan.jeepay.pay.ctrl.payorder.AbstractPayOrderController; import com.jeequan.jeepay.pay.ctrl.payorder.AbstractPayOrderController;
import com.jeequan.jeepay.pay.model.MchConfigContext;
import com.jeequan.jeepay.pay.rqrs.ChannelUserIdRQ; import com.jeequan.jeepay.pay.rqrs.ChannelUserIdRQ;
import com.jeequan.jeepay.pay.service.ConfigContextService; import com.jeequan.jeepay.pay.service.ConfigContextService;
import com.jeequan.jeepay.pay.model.MchConfigContext;
import com.jeequan.jeepay.service.impl.SysConfigService; import com.jeequan.jeepay.service.impl.SysConfigService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -33,8 +35,6 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -33,8 +35,6 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.net.URLEncoder;
/* /*
* 商户获取渠道用户ID接口 * 商户获取渠道用户ID接口
* *
...@@ -65,6 +65,10 @@ public class ChannelUserIdController extends AbstractPayOrderController { ...@@ -65,6 +65,10 @@ public class ChannelUserIdController extends AbstractPayOrderController {
throw new BizException("不支持的客户端"); throw new BizException("不支持的客户端");
} }
if(!StringKit.isAvailableUrl(rq.getRedirectUrl())){
throw new BizException("跳转地址有误!");
}
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("mchNo", rq.getMchNo()); jsonObject.put("mchNo", rq.getMchNo());
jsonObject.put("ifCode", ifCode); jsonObject.put("ifCode", ifCode);
...@@ -101,9 +105,11 @@ public class ChannelUserIdController extends AbstractPayOrderController { ...@@ -101,9 +105,11 @@ public class ChannelUserIdController extends AbstractPayOrderController {
//获取商户配置信息 //获取商户配置信息
MchConfigContext mchConfigContext = configContextService.getMchConfigContext(mchNo); MchConfigContext mchConfigContext = configContextService.getMchConfigContext(mchNo);
//获取渠道用户ID
String channelUserId = channelUserService.getChannelUserId(getReqParamJSON(), mchConfigContext); String channelUserId = channelUserService.getChannelUserId(getReqParamJSON(), mchConfigContext);
response.sendRedirect(redirectUrl + "?channelId=" + URLEncoder.encode(channelUserId)); //同步跳转
response.sendRedirect(StringKit.appendUrlQuery(redirectUrl, JsonKit.newJson("channelUserId", channelUserId)));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册