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
bccd3776
Commit
bccd3776
authored
Nov 19, 2022
by
zhuxiao
Browse files
支付成功通知改为body形式,支持特殊字符
parent
c4eb4849
Changes
1
Hide whitespace changes
Inline
Side-by-side
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/mq/PayOrderMchNotifyMQReceiver.java
View file @
bccd3776
...
...
@@ -16,11 +16,12 @@
package
com.jeequan.jeepay.pay.mq
;
import
cn.hutool.core.net.url.UrlBuilder
;
import
cn.hutool.
http.HttpException
;
import
cn.hutool.
core.util.StrUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.jeequan.jeepay.components.mq.model.PayOrderMchNotifyMQ
;
import
com.jeequan.jeepay.components.mq.vender.IMQSender
;
import
com.jeequan.jeepay.core.entity.MchNotifyRecord
;
import
com.jeequan.jeepay.core.exception.BizException
;
import
com.jeequan.jeepay.service.impl.MchNotifyRecordService
;
import
com.jeequan.jeepay.service.impl.PayOrderService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -68,7 +69,15 @@ public class PayOrderMchNotifyMQReceiver implements PayOrderMchNotifyMQ.IMQRecei
String
notifyUrl
=
record
.
getNotifyUrl
();
String
res
=
""
;
try
{
res
=
HttpUtil
.
createPost
(
notifyUrl
).
timeout
(
20000
).
execute
().
body
();
// res = HttpUtil.createPost(notifyUrl).timeout(20000).execute().body();
int
pathEndPos
=
notifyUrl
.
indexOf
(
'?'
);
if
(
pathEndPos
<=
-
1
)
{
log
.
error
(
"通知地址错误,参数为空,notifyUrl:{}"
,
notifyUrl
);
throw
new
BizException
(
"通知地址错误"
);
}
res
=
HttpUtil
.
post
(
StrUtil
.
subPre
(
notifyUrl
,
pathEndPos
),
StrUtil
.
subSuf
(
notifyUrl
,
pathEndPos
+
1
),
20000
);
}
catch
(
Exception
e
)
{
log
.
error
(
"http error"
,
e
);
res
=
"连接["
+
UrlBuilder
.
of
(
notifyUrl
).
getHost
()
+
"]异常:【"
+
e
.
getMessage
()
+
"】"
;
...
...
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