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
b611654f
Commit
b611654f
authored
Aug 20, 2017
by
jmdhappy
Browse files
修复保存支付宝渠道私钥+号转空格的bug
parent
084b9512
Changes
1
Hide whitespace changes
Inline
Side-by-side
xxpay-mgr/src/main/java/org/xxpay/mgr/controller/PayChannelController.java
View file @
b611654f
...
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.ModelMap
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.xxpay.common.constant.PayConstant
;
import
org.xxpay.common.util.DateUtil
;
import
org.xxpay.common.util.MyLog
;
import
org.xxpay.dal.dao.model.PayChannel
;
...
...
@@ -69,14 +70,26 @@ public class PayChannelController {
@ResponseBody
public
String
save
(
@RequestParam
String
params
)
{
JSONObject
po
=
JSONObject
.
parseObject
(
params
);
String
channelId
=
po
.
getString
(
"channelId"
);
String
param
=
po
.
getString
(
"param"
);
// 对于配置支付宝参数时,前端将+号转为空格bug处理
if
(
PayConstant
.
PAY_CHANNEL_ALIPAY_MOBILE
.
equals
(
channelId
)
||
PayConstant
.
PAY_CHANNEL_ALIPAY_PC
.
equals
(
channelId
)
||
PayConstant
.
PAY_CHANNEL_ALIPAY_WAP
.
equals
(
channelId
))
{
JSONObject
paramObj
=
po
.
getJSONObject
(
"param"
);
paramObj
.
put
(
"private_key"
,
paramObj
.
getString
(
"private_key"
).
replaceAll
(
" "
,
"+"
));
paramObj
.
put
(
"public_key"
,
paramObj
.
getString
(
"public_key"
).
replaceAll
(
" "
,
"+"
));
param
=
paramObj
.
toJSONString
();
}
PayChannel
payChannel
=
new
PayChannel
();
Integer
id
=
po
.
getInteger
(
"id"
);
payChannel
.
setChannelId
(
po
.
getString
(
"
channelId
"
)
);
payChannel
.
setChannelId
(
channelId
);
payChannel
.
setMchId
(
po
.
getString
(
"mchId"
));
payChannel
.
setChannelName
(
po
.
getString
(
"channelName"
));
payChannel
.
setChannelMchId
(
po
.
getString
(
"channelMchId"
));
payChannel
.
setState
((
byte
)
(
"on"
.
equalsIgnoreCase
(
po
.
getString
(
"state"
))
?
1
:
0
));
payChannel
.
setParam
(
po
.
getString
(
"
param
"
)
);
payChannel
.
setParam
(
param
);
payChannel
.
setRemark
(
po
.
getString
(
"remark"
));
int
result
;
if
(
id
==
null
)
{
...
...
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