记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
b5d13365
Commit
b5d13365
authored
May 20, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改退款
parent
896a4de4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+6
-1
PayWepayUtils.java
...ava/com/liquidnet/service/dragon/utils/PayWepayUtils.java
+39
-0
No files found.
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
b5d13365
...
@@ -438,7 +438,12 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -438,7 +438,12 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
try
{
try
{
HttpPost
httpost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/secapi/pay/refund"
);
HttpPost
httpost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/secapi/pay/refund"
);
httpost
.
setEntity
(
new
StringEntity
(
data
,
"UTF-8"
));
httpost
.
setEntity
(
new
StringEntity
(
data
,
"UTF-8"
));
CloseableHttpResponse
response
=
PayWepayUtils
.
getInstance
().
getHttpClient
().
execute
(
httpost
);
CloseableHttpResponse
response
=
null
;
if
(
code
.
contains
(
"b"
)){
response
=
PayWepayUtils
.
getInstance
().
getHttpClientB
().
execute
(
httpost
);
}
else
{
response
=
PayWepayUtils
.
getInstance
().
getHttpClient
().
execute
(
httpost
);
}
try
{
try
{
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
entity
.
getContent
();
entity
.
getContent
();
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/PayWepayUtils.java
View file @
b5d13365
...
@@ -157,6 +157,45 @@ public class PayWepayUtils {
...
@@ -157,6 +157,45 @@ public class PayWepayUtils {
}
}
return
httpClient
;
return
httpClient
;
}
}
public
CloseableHttpClient
getHttpClientB
()
{
try
{
if
(
httpClient
==
null
)
{
InputStream
certStream
=
PayWepayUtils
.
class
.
getClassLoader
().
getResourceAsStream
(
"payCert/wepayb/apiclient_cert.p12"
);
byte
[]
certData
=
IOUtils
.
toByteArray
(
certStream
);
certStream
.
read
(
certData
);
certStream
.
close
();
KeyStore
keyStore
=
KeyStore
.
getInstance
(
"PKCS12"
);
ByteArrayInputStream
inputStream
=
new
ByteArrayInputStream
(
certData
);
try
{
keyStore
.
load
(
inputStream
,
merchantId
.
toCharArray
());
}
finally
{
inputStream
.
close
();
}
SSLContext
sslcontext
=
SSLContexts
.
custom
()
.
loadKeyMaterial
(
keyStore
,
merchantId
.
toCharArray
())
.
build
();
SSLConnectionSocketFactory
sslsf
=
new
SSLConnectionSocketFactory
(
sslcontext
,
SSLConnectionSocketFactory
.
getDefaultHostnameVerifier
());
// 配置同时支持 HTTP 和 HTPPS
Registry
<
ConnectionSocketFactory
>
socketFactoryRegistry
=
RegistryBuilder
.<
ConnectionSocketFactory
>
create
().
register
(
"http"
,
PlainConnectionSocketFactory
.
getSocketFactory
()).
register
(
"https"
,
sslsf
).
build
();
// 初始化连接管理器
poolConnManager
=
new
PoolingHttpClientConnectionManager
(
socketFactoryRegistry
);
poolConnManager
.
setMaxTotal
(
4000
);
// 同时最多连接数
// 设置最大路由
poolConnManager
.
setDefaultMaxPerRoute
(
2000
);
// 初始化httpClient
httpClient
=
getConnection
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
httpClient
;
}
public
static
CloseableHttpClient
getConnection
()
{
public
static
CloseableHttpClient
getConnection
()
{
RequestConfig
config
=
RequestConfig
.
custom
().
setConnectTimeout
(
5000
).
setConnectionRequestTimeout
(
5000
).
setSocketTimeout
(
5000
).
build
();
RequestConfig
config
=
RequestConfig
.
custom
().
setConnectTimeout
(
5000
).
setConnectionRequestTimeout
(
5000
).
setSocketTimeout
(
5000
).
build
();
...
...
Write
Preview
Markdown
is supported
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