记得上下班打卡 | 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
661ff465
Commit
661ff465
authored
Aug 05, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dragon - 退款返回错误内容
parent
00a41d21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+6
-6
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 @
661ff465
...
@@ -158,6 +158,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -158,6 +158,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
parameters
);
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
parameters
);
parameters
.
put
(
"sign"
,
sign
);
parameters
.
put
(
"sign"
,
sign
);
String
data
=
PayWepayUtils
.
getInstance
().
getRequestXml
(
parameters
);
String
data
=
PayWepayUtils
.
getInstance
().
getRequestXml
(
parameters
);
String
refundError
=
""
;
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"
));
...
@@ -170,7 +171,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -170,7 +171,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
WePayRefundReturnDto
wePayRefundReturnDto
=
XmlUtil
.
toBean
(
jsonStr
,
WePayRefundReturnDto
.
class
);
WePayRefundReturnDto
wePayRefundReturnDto
=
XmlUtil
.
toBean
(
jsonStr
,
WePayRefundReturnDto
.
class
);
if
(
wePayRefundReturnDto
.
getErrCodeDes
()
!=
null
)
{
if
(
wePayRefundReturnDto
.
getErrCodeDes
()
!=
null
)
{
channelDto
.
setResult
(
"error"
);
channelDto
.
setResult
(
"error"
);
channelDto
.
setMessage
(
paymentType
+
" refund error: "
+
wePayRefundReturnDto
.
getErrCodeDes
());
channelDto
.
setMessage
(
wePayRefundReturnDto
.
getErrCodeDes
());
contentDto
.
setRequest
(
data
);
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
channelDto
.
setContent
(
contentDto
);
...
@@ -178,7 +179,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -178,7 +179,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
}
}
if
(!
wePayRefundReturnDto
.
getReturnCode
().
equalsIgnoreCase
(
"SUCCESS"
)
||
wePayRefundReturnDto
.
getReturnCode
()
==
null
)
{
if
(!
wePayRefundReturnDto
.
getReturnCode
().
equalsIgnoreCase
(
"SUCCESS"
)
||
wePayRefundReturnDto
.
getReturnCode
()
==
null
)
{
try
{
try
{
String
refundError
=
""
;
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
if
(
null
==
wePayRefundReturnDto
.
getReturnMsg
())
{
if
(
null
==
wePayRefundReturnDto
.
getReturnMsg
())
{
refundError
=
"退款失败,原因未知"
;
refundError
=
"退款失败,原因未知"
;
...
@@ -203,7 +203,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -203,7 +203,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return
channelDto
;
return
channelDto
;
}
}
channelDto
.
setResult
(
"error"
);
channelDto
.
setResult
(
"error"
);
channelDto
.
setMessage
(
paymentType
+
" refund error: "
);
channelDto
.
setMessage
(
refundError
);
contentDto
.
setRequest
(
data
);
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
channelDto
.
setContent
(
contentDto
);
...
@@ -262,6 +262,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -262,6 +262,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
RefundContentDto
contentDto
=
new
RefundContentDto
();
RefundContentDto
contentDto
=
new
RefundContentDto
();
AlipayTradeRefundRequest
request
=
new
AlipayTradeRefundRequest
();
//创建API对应的request类
AlipayTradeRefundRequest
request
=
new
AlipayTradeRefundRequest
();
//创建API对应的request类
try
{
try
{
String
refundError
=
""
;
request
.
setBizContent
(
"{"
+
request
.
setBizContent
(
"{"
+
"\"out_trade_no\":\""
+
code
+
"\","
+
"\"out_trade_no\":\""
+
code
+
"\","
+
"\"trade_no\":\""
+
paymentId
+
"\","
+
"\"trade_no\":\""
+
paymentId
+
"\","
+
...
@@ -269,9 +270,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -269,9 +270,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
"\"refund_reason\":\""
+
reason
+
"\","
+
"\"refund_reason\":\""
+
reason
+
"\","
+
"\"refund_amount\":\""
+
price
.
doubleValue
()
+
"\"}"
);
//设置业务参数
"\"refund_amount\":\""
+
price
.
doubleValue
()
+
"\"}"
);
//设置业务参数
AlipayTradeRefundResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
AlipayTradeRefundResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
if
(
response
.
getFundChange
()
.
equals
(
"N"
)
||
response
.
getFundChange
()
==
null
)
{
if
(
response
.
getFundChange
()
==
null
||
response
.
getFundChange
().
equals
(
"N"
)
)
{
try
{
try
{
String
refundError
=
""
;
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
if
(
null
==
response
.
getSubMsg
())
{
if
(
null
==
response
.
getSubMsg
())
{
refundError
=
"退款失败,原因未知"
;
refundError
=
"退款失败,原因未知"
;
...
@@ -296,7 +296,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -296,7 +296,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return
channelDto
;
return
channelDto
;
}
}
channelDto
.
setResult
(
"error"
);
channelDto
.
setResult
(
"error"
);
channelDto
.
setMessage
(
paymentType
+
" refund error: "
);
channelDto
.
setMessage
(
refundError
);
contentDto
.
setRequest
(
JSON
.
toJSONString
(
response
.
getParams
()));
contentDto
.
setRequest
(
JSON
.
toJSONString
(
response
.
getParams
()));
contentDto
.
setResponse
(
response
.
getBody
());
contentDto
.
setResponse
(
response
.
getBody
());
channelDto
.
setContent
(
contentDto
);
channelDto
.
setContent
(
contentDto
);
...
...
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