记得上下班打卡 | 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
67294442
Commit
67294442
authored
Nov 18, 2021
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
银联退款回调
parent
aca6d629
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
3 deletions
+55
-3
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+55
-3
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 @
67294442
...
@@ -11,9 +11,11 @@ import com.liquidnet.commons.lang.util.IDGenerator;
...
@@ -11,9 +11,11 @@ import com.liquidnet.commons.lang.util.IDGenerator;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.dragon.channel.unionpay.biz.UnionpayBiz
;
import
com.liquidnet.service.dragon.channel.unionpay.constant.UnionpayConstant
;
import
com.liquidnet.service.dragon.channel.unionpay.constant.UnionpayConstant
;
import
com.liquidnet.service.dragon.channel.unionpay.sdk.AcpService
;
import
com.liquidnet.service.dragon.channel.unionpay.sdk.AcpService
;
import
com.liquidnet.service.dragon.channel.unionpay.sdk.SDKConfig
;
import
com.liquidnet.service.dragon.channel.unionpay.sdk.SDKConfig
;
import
com.liquidnet.service.dragon.channel.unionpay.sdk.SDKConstants
;
import
com.liquidnet.service.dragon.channel.wepay.resp.AliPayRefundReturnCallBackDto
;
import
com.liquidnet.service.dragon.channel.wepay.resp.AliPayRefundReturnCallBackDto
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WePayRefundReturnCallBackDto
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WePayRefundReturnCallBackDto
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WePayRefundReturnCallBackInfoDto
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WePayRefundReturnCallBackInfoDto
;
...
@@ -67,7 +69,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -67,7 +69,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
//银联 商户号码
//银联 商户号码
@Value
(
"${liquidnet.dragon.unionpay.merchantId}"
)
@Value
(
"${liquidnet.dragon.unionpay.merchantId}"
)
private
String
unionMerchantId
;
private
String
unionMerchantId
;
@Autowired
private
UnionpayBiz
unionpayBiz
;
@Override
@Override
public
ResponseDto
<
DragonRefundAppDto
>
dragonRefund
(
String
orderCode
,
String
code
,
String
orderRefundCode
,
String
reason
,
String
notifyUrl
,
BigDecimal
price
,
String
paymentType
,
String
paymentId
,
BigDecimal
priceTotal
)
{
public
ResponseDto
<
DragonRefundAppDto
>
dragonRefund
(
String
orderCode
,
String
code
,
String
orderRefundCode
,
String
reason
,
String
notifyUrl
,
BigDecimal
price
,
String
paymentType
,
String
paymentId
,
BigDecimal
priceTotal
)
{
try
{
try
{
...
@@ -152,7 +155,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -152,7 +155,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
data
.
put
(
"signMethod"
,
sdkConfig
.
getSignMethod
());
//签名方法
data
.
put
(
"signMethod"
,
sdkConfig
.
getSignMethod
());
//签名方法
data
.
put
(
"txnType"
,
"04"
);
//交易类型 04-退货
data
.
put
(
"txnType"
,
"04"
);
//交易类型 04-退货
data
.
put
(
"txnSubType"
,
"00"
);
//交易子类型 默认00
data
.
put
(
"txnSubType"
,
"00"
);
//交易子类型 默认00
data
.
put
(
"bizType"
,
"0
00
201"
);
//业务类型
data
.
put
(
"bizType"
,
"0201"
);
//业务类型
data
.
put
(
"channelType"
,
"08"
);
//渠道类型,07-PC,08-手机
data
.
put
(
"channelType"
,
"08"
);
//渠道类型,07-PC,08-手机
/***商户接入参数***/
/***商户接入参数***/
data
.
put
(
"merId"
,
unionMerchantId
);
//商户号码,请改成自己申请的商户号或者open上注册得来的777商户号测试
data
.
put
(
"merId"
,
unionMerchantId
);
//商户号码,请改成自己申请的商户号或者open上注册得来的777商户号测试
...
@@ -476,7 +479,56 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -476,7 +479,56 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return
null
;
return
null
;
}
}
}
}
/**
* @author zhangfuxin
* @Description: 银联退款回调
* @date 2021/11/18 下午1:32
*/
public
String
unionRefundCallBack
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
try
{
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
encoding
=
request
.
getParameter
(
SDKConstants
.
param_encoding
);
Map
<
String
,
String
>
notifyMap
=
unionpayBiz
.
parseNotifyMsg
(
request
);
log
.
info
(
"银联退款回调{}"
,
JSON
.
toJSONString
(
notifyMap
));
if
(!
acpService
.
validate
(
notifyMap
,
encoding
))
{
//验签失败,需解决验签问题
log
.
error
(
"银联回调,验签失败。"
);
}
else
{
String
orderId
=
notifyMap
.
get
(
"orderId"
);
//获取后台通知的数据,其他字段也可用类似方式获取
String
respCode
=
notifyMap
.
get
(
"respCode"
);
NotifyUrlDto
dto
=
new
NotifyUrlDto
();
//成功
if
(
respCode
.
equals
(
"00"
)||
respCode
.
equals
(
"A6"
)){
dto
.
setStatus
(
1
);
}
else
{
dto
.
setStatus
(
0
);
}
//商户订单号 商户退款单号
dto
.
setOrderRefundCode
(
orderId
);
//银联无这个
dto
.
setRefundCode
(
""
);
dto
.
setRefundPrice
(
new
BigDecimal
(
notifyMap
.
get
(
"settleAmt"
)).
divide
(
BigDecimal
.
valueOf
(
100
)).
toString
());
dto
.
setRefundAt
(
notifyMap
.
get
(
"traceTime"
));
// 应答信息
dto
.
setRefundError
(
notifyMap
.
get
(
"respMsg"
));
log
.
info
(
"SEND WEPAY NOTIFTURL = "
+
JSON
.
toJSONString
(
dto
));
sendNotifyUrl
(
dto
,
null
);
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
new
Object
[]{
orderId
,
""
,
JSON
.
toJSONString
(
notifyMap
),
nowTime
,
nowTime
},
DragonConstant
.
MysqlRedisQueueEnum
.
DRAGON_REFUND_KEY
.
getCode
()
);
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_success.update"
),
new
Object
[]{
nowTime
,
notifyMap
.
get
(
"traceTime"
),
DragonConstant
.
RefundStatusEnum
.
STATUS_REFUNDED
.
getCode
(),
orderId
},
DragonConstant
.
MysqlRedisQueueEnum
.
DRAGON_REFUND_KEY
.
getCode
()
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
"ok"
;
}
@Override
@Override
public
String
wePayRefundCallBack
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
String
wePayRefundCallBack
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
InputStream
inStream
;
InputStream
inStream
;
...
...
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