Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
975f1eea
Commit
975f1eea
authored
Jun 11, 2021
by
terrfly
Browse files
优化商户获取渠道用户API
parent
90be6ce8
Changes
1
Hide whitespace changes
Inline
Side-by-side
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/ctrl/qr/ChannelUserIdController.java
View file @
975f1eea
...
@@ -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
)));
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment