记得上下班打卡 | 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
a4c37a06
Commit
a4c37a06
authored
Jul 13, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 微信退款接口
parent
2d6f06c7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
205 additions
and
135 deletions
+205
-135
IDragonOrderRefundsService.java
...et/service/dragon/service/IDragonOrderRefundsService.java
+1
-1
WePayRefundReturnDto.java
...rvice/dragon/channel/wepay/resp/WePayRefundReturnDto.java
+46
-0
RefundController.java
...liquidnet/service/dragon/controller/RefundController.java
+3
-2
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+153
-132
PayWepayUtils.java
...ava/com/liquidnet/service/dragon/utils/PayWepayUtils.java
+2
-0
No files found.
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/service/IDragonOrderRefundsService.java
View file @
a4c37a06
...
...
@@ -18,7 +18,7 @@ public interface IDragonOrderRefundsService {
* @param price 退款金额
* @param paymentType 支付类型
*/
ResponseDto
<
DragonRefundAppDto
>
dragonRefund
(
String
orderCode
,
String
tradeNo
,
String
outTradeNo
,
String
reason
,
String
returnUrl
,
BigDecimal
price
,
String
paymentType
,
String
paymentId
);
ResponseDto
<
DragonRefundAppDto
>
dragonRefund
(
String
orderCode
,
String
tradeNo
,
String
outTradeNo
,
String
reason
,
String
returnUrl
,
BigDecimal
price
,
String
paymentType
,
String
paymentId
,
BigDecimal
priceTotal
);
ResponseDto
<
DragonRefundAppDto
>
wePayRefundCallBack
();
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/resp/WePayRefundReturnDto.java
0 → 100644
View file @
a4c37a06
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
resp
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.thoughtworks.xstream.annotations.XStreamAlias
;
import
lombok.Data
;
@Data
@XStreamAlias
(
"xml"
)
public
class
WePayRefundReturnDto
{
@XStreamAlias
(
"return_code"
)
private
String
returnCode
;
@XStreamAlias
(
"return_msg"
)
private
String
returnMsg
;
@XStreamAlias
(
"appid"
)
private
String
appId
;
@XStreamAlias
(
"mch_id"
)
private
String
mchId
;
@XStreamAlias
(
"nonce_str"
)
private
String
nonceStr
;
@XStreamAlias
(
"sign"
)
private
String
sign
;
@XStreamAlias
(
"result_code"
)
private
String
resultCode
;
@XStreamAlias
(
"transaction_id"
)
private
String
transactionId
;
@XStreamAlias
(
"out_trade_no"
)
private
String
outTradeNo
;
@XStreamAlias
(
"out_refund_no"
)
private
String
outRefundNo
;
@XStreamAlias
(
"refund_id"
)
private
String
refundId
;
@XStreamAlias
(
"refund_channel"
)
private
String
refundChannel
;
@XStreamAlias
(
"refund_fee"
)
private
String
refundFee
;
@XStreamAlias
(
"coupon_refund_fee"
)
private
String
couponRefundFee
;
@XStreamAlias
(
"total_fee"
)
private
String
totalFee
;
@XStreamAlias
(
"cash_fee"
)
private
String
cashFee
;
@XStreamAlias
(
"coupon_refund_count"
)
private
String
couponRefundCount
;
@XStreamAlias
(
"cash_refund_fee"
)
private
String
cashRefundFee
;
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/RefundController.java
View file @
a4c37a06
...
...
@@ -41,9 +41,10 @@ public class RefundController {
@RequestParam
(
value
=
"orderRefundCode"
)
@NotNull
(
message
=
"退款单号不能为空"
)
String
orderRefundCode
,
@RequestParam
(
value
=
"reason"
)
@NotNull
(
message
=
"退款原因不能为空"
)
String
reason
,
@RequestParam
(
value
=
"notifyUrl"
)
@NotNull
(
message
=
"回调地址不能为空"
)
String
returnUrl
,
@RequestParam
(
value
=
"price"
)
@NotNull
(
message
=
"价格不能为空"
)
BigDecimal
price
,
@RequestParam
(
value
=
"price"
)
@NotNull
(
message
=
"退款价格不能为空"
)
BigDecimal
price
,
@RequestParam
(
value
=
"priceTotal"
)
@NotNull
(
message
=
"订单价格不能为空"
)
BigDecimal
priceTotal
,
@RequestParam
(
value
=
"paymentType"
)
@NotNull
(
message
=
"支付类型不能为空"
)
String
paymentType
,
@RequestParam
(
value
=
"paymentId"
)
@NotNull
(
message
=
"支付订单号不能为空"
)
String
paymentId
)
{
return
orderRefundsService
.
dragonRefund
(
orderCode
,
code
,
orderRefundCode
,
reason
,
returnUrl
,
price
,
paymentType
,
paymentId
);
return
orderRefundsService
.
dragonRefund
(
orderCode
,
code
,
orderRefundCode
,
reason
,
returnUrl
,
price
,
paymentType
,
paymentId
,
priceTotal
);
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
a4c37a06
...
...
@@ -3,8 +3,6 @@ package com.liquidnet.service.dragon.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alipay.api.request.AlipayTradeRefundRequest
;
import
com.alipay.api.response.AlipayTradeRefundResponse
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
...
...
@@ -13,9 +11,11 @@ import com.liquidnet.service.dragon.constant.DragonConstant;
import
com.liquidnet.service.dragon.dto.DragonRefundAppDto
;
import
com.liquidnet.service.dragon.dto.DragonRefundChannelDto
;
import
com.liquidnet.service.dragon.dto.RefundContentDto
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WePayRefundReturnDto
;
import
com.liquidnet.service.dragon.service.IDragonOrderRefundsService
;
import
com.liquidnet.service.dragon.utils.PayAlipayUtils
;
import
com.liquidnet.service.dragon.utils.PayWepayUtils
;
import
com.liquidnet.service.dragon.utils.XmlUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
...
...
@@ -28,7 +28,6 @@ import org.springframework.data.redis.connection.stream.StreamRecords;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.io.ByteArrayOutputStream
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.*
;
...
...
@@ -42,34 +41,171 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
@Override
public
void
sendRedisQueue
()
{
}
@Override
public
ResponseDto
<
DragonRefundAppDto
>
dragonRefund
(
String
orderCode
,
String
code
,
String
orderRefundCode
,
String
reason
,
String
notifyUrl
,
BigDecimal
price
,
String
paymentType
,
String
paymentId
,
BigDecimal
priceTotal
)
{
try
{
// PayWepayUtils payWepayUtils = new PayWepayUtils();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
refundCode
=
IDGenerator
.
refundCode
();
String
orderRefundId
=
IDGenerator
.
nextSnowId
();
//创建退款单
boolean
insertResult
=
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund.insert"
),
new
Object
[]{
orderRefundId
,
refundCode
,
orderRefundCode
,
price
,
reason
,
notifyUrl
,
paymentType
,
nowTime
,
nowTime
}
);
DragonRefundChannelDto
dto
=
null
;
if
(
insertResult
)
{
switch
(
paymentType
)
{
case
DragonConstant
.
REFUND_TYPE_APP_ALIPAY
:
dto
=
aliPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
paymentId
,
paymentType
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_WAP_ALIPAY
:
dto
=
aliPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
paymentId
,
paymentType
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_WEB_ALIPAY
:
dto
=
aliPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
paymentId
,
paymentType
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_APP_WEPAY
:
dto
=
weyPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
priceTotal
,
paymentId
,
paymentType
,
notifyUrl
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_WAP_WEPAY
:
dto
=
weyPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
priceTotal
,
paymentId
,
paymentType
,
notifyUrl
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_WEB_WEPAY
:
dto
=
weyPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
priceTotal
,
paymentId
,
paymentType
,
notifyUrl
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_JS_WEPAY
:
dto
=
weyPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
priceTotal
,
paymentId
,
paymentType
,
notifyUrl
,
nowTime
);
break
;
}
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunding"
))
{
log
.
info
(
""
);
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunded"
))
{
//调用回调
log
.
info
(
""
);
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"error"
))
{
//调用回调
log
.
error
(
""
);
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"exception"
))
{
log
.
error
(
""
);
}
DragonRefundAppDto
refundAppDto
=
new
DragonRefundAppDto
();
refundAppDto
.
setOrderCode
(
orderCode
);
refundAppDto
.
setCode
(
code
);
refundAppDto
.
setOrderRefundCode
(
orderRefundCode
);
refundAppDto
.
setRefundCode
(
refundCode
);
return
ResponseDto
.
success
(
refundAppDto
);
}
else
{
return
ResponseDto
.
failure
(
"退款失败"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
""
);
return
ResponseDto
.
failure
(
"退款失败:"
+
e
.
getMessage
());
}
}
@Override
public
ResponseDto
<
DragonRefundAppDto
>
wePayRefundCallBack
()
{
return
null
;
}
public
DragonRefundChannelDto
weyPayRefund
(
String
orderRefundId
,
String
refundCode
,
String
code
,
String
reason
,
BigDecimal
price
,
BigDecimal
priceTotal
,
String
paymentId
,
String
paymentType
,
String
notifyUrl
,
LocalDateTime
nowTime
)
{
try
{
String
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
DragonRefundChannelDto
channelDto
=
new
DragonRefundChannelDto
();
RefundContentDto
contentDto
=
new
RefundContentDto
();
String
nonceStr
=
PayWepayUtils
.
getInstance
().
getNonceStr
();
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<>();
parameters
.
put
(
"mch_id"
,
PayWepayUtils
.
getInstance
().
getMerchantId
());
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAppId
());
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"out_refund_no"
,
"20210710140233163870197466289T"
);
parameters
.
put
(
"out_trade_no"
,
"20210710140233163870197466289P"
);
parameters
.
put
(
"refund_fee"
,
"1"
);
parameters
.
put
(
"total_fee"
,
"1"
);
parameters
.
put
(
"notify_url"
,
"https://www.baidu.com"
);
parameters
.
put
(
"refund_desc"
,
"测试退款"
);
parameters
.
put
(
"out_refund_no"
,
refundCode
);
parameters
.
put
(
"out_trade_no"
,
code
);
parameters
.
put
(
"refund_fee"
,
price
.
doubleValue
()
*
100
);
parameters
.
put
(
"total_fee"
,
priceTotal
.
doubleValue
()
*
100
);
parameters
.
put
(
"notify_url"
,
notifyUrl
);
parameters
.
put
(
"refund_desc"
,
reason
);
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
parameters
);
parameters
.
put
(
"sign"
,
sign
);
String
data
=
PayWepayUtils
.
getInstance
().
getRequestXml
(
parameters
);
try
{
HttpPost
httpost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/secapi/pay/refund"
);
httpost
.
setEntity
(
new
StringEntity
(
data
,
"UTF-8"
));
CloseableHttpResponse
response
=
PayWepayUtils
.
getInstance
().
getHttpClient
().
execute
(
httpost
);
try
{
HttpEntity
entity
=
response
.
getEntity
();
//接受到返回信息
String
jsonStr
=
EntityUtils
.
toString
(
response
.
getEntity
(),
"UTF-8"
);
entity
.
getContent
();
String
jsonStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
WePayRefundReturnDto
wePayRefundReturnDto
=
XmlUtil
.
toBean
(
jsonStr
,
WePayRefundReturnDto
.
class
);
if
(!
wePayRefundReturnDto
.
getResultCode
().
equalsIgnoreCase
(
"SUCCESS"
)
||
wePayRefundReturnDto
.
getResultCode
()
==
null
)
{
try
{
String
refundError
=
""
;
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
if
(
null
==
wePayRefundReturnDto
.
getReturnMsg
())
{
refundError
=
"退款失败,原因未知"
;
}
else
{
refundError
=
wePayRefundReturnDto
.
getReturnMsg
();
}
// 修改退款订单
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_error.update"
),
new
Object
[]{
nowTime
,
refundError
,
refundStatus
,
orderRefundId
}
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
//保存错误信息
log
.
error
(
""
);
channelDto
.
setResult
(
"exception"
);
channelDto
.
setMessage
(
"update order refund with db error: "
+
e
.
getMessage
());
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
return
channelDto
;
}
channelDto
.
setResult
(
"error"
);
channelDto
.
setMessage
(
paymentType
+
" refund error: "
);
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
return
channelDto
;
}
// 创建退款日志
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
new
Object
[]{
orderRefundId
,
paymentType
,
data
,
nowTime
,
nowTime
}
);
try
{
if
(
wePayRefundReturnDto
.
getResultCode
().
equalsIgnoreCase
(
"SUCCESS"
))
{
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_REFUNDED
.
getCode
();
}
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_success.update"
),
new
Object
[]{
nowTime
,
null
,
refundStatus
,
orderRefundId
}
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
""
);
channelDto
.
setResult
(
"exception"
);
channelDto
.
setMessage
(
"update order refund with db error: "
+
e
.
getMessage
());
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
return
channelDto
;
}
channelDto
.
setResult
(
"refunded"
);
channelDto
.
setMessage
(
paymentType
+
" refund info: "
);
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
EntityUtils
.
consume
(
entity
);
System
.
out
.
println
(
jsonStr
)
;
return
channelDto
;
}
finally
{
response
.
close
();
}
...
...
@@ -78,121 +214,11 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
""
);
return
null
;
}
}
@Override
public
ResponseDto
<
DragonRefundAppDto
>
dragonRefund
(
String
orderCode
,
String
code
,
String
orderRefundCode
,
String
reason
,
String
notifyUrl
,
BigDecimal
price
,
String
paymentType
,
String
paymentId
)
{
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
refundCode
=
IDGenerator
.
refundCode
();
String
orderRefundId
=
IDGenerator
.
nextSnowId
();
//创建退款单
boolean
insertResult
=
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund.insert"
),
new
Object
[]{
orderRefundId
,
refundCode
,
orderRefundCode
,
price
,
reason
,
notifyUrl
,
paymentType
,
nowTime
,
nowTime
}
);
if
(
insertResult
)
{
switch
(
paymentType
)
{
case
DragonConstant
.
REFUND_TYPE_APP_ALIPAY
:
aliPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
paymentId
,
paymentType
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_WAP_ALIPAY
:
aliPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
paymentId
,
paymentType
,
nowTime
);
break
;
case
DragonConstant
.
REFUND_TYPE_WEB_ALIPAY
:
aliPayRefund
(
orderRefundId
,
orderRefundCode
,
code
,
reason
,
price
,
paymentId
,
paymentType
,
nowTime
);
break
;
}
DragonRefundAppDto
refundAppDto
=
new
DragonRefundAppDto
();
refundAppDto
.
setOrderCode
(
orderCode
);
refundAppDto
.
setCode
(
code
);
refundAppDto
.
setOrderRefundCode
(
orderRefundCode
);
refundAppDto
.
setRefundCode
(
refundCode
);
return
ResponseDto
.
success
(
refundAppDto
);
}
else
{
return
ResponseDto
.
failure
(
"退款失败"
);
}
}
public
void
weyPayRefund
()
{
}
public
void
wepaySomeThing
(){
DragonRefundChannelDto
channelDto
=
new
DragonRefundChannelDto
();
RefundContentDto
contentDto
=
new
RefundContentDto
();
String
xml
=
"<xml><result_code>SUCCESS</result_code></xml>"
;
// if (response.getFundChange().equals("N") || response.getFundChange() == null) {
// try {
// String refundError = "";
// refundStatus = DragonConstant.RefundStatusEnum.STATUS_ERROR.getCode();
// if (null == response.getSubMsg()) {
// refundError = "退款失败,原因未知";
// } else {
// refundError = response.getSubMsg();
// }
// // 修改退款订单
// sendMySqlRedis(
// SqlMapping.get("dragon_order_refund_error.update"),
// new Object[]{nowTime, refundError, refundStatus, orderRefundId}
// );
// } catch (Exception e) {
// e.printStackTrace();
// //保存错误信息
// log.error("");
// channelDto.setResult("exception");
// channelDto.setMessage("update order refund with db error: " + e.getMessage());
// contentDto.setRequest(JSON.toJSONString(response.getParams()));
// contentDto.setResponse(response.getBody());
// channelDto.setContent(contentDto);
// return channelDto;
// }
// channelDto.setResult("error");
// channelDto.setMessage(paymentType + " refund error: ");
// contentDto.setRequest(JSON.toJSONString(response.getParams()));
// contentDto.setResponse(response.getBody());
// channelDto.setContent(contentDto);
// return channelDto;
// }
//
// // 创建退款日志
// sendMySqlRedis(
// SqlMapping.get("dragon_order_refund_log.insert"),
// new Object[]{orderRefundId, paymentType, JSON.toJSONString(response.getBody()), nowTime, nowTime}
// );
// try {
// String refundAt = "";
// if (response.getFundChange().equals("Y")) {
// refundStatus = DragonConstant.RefundStatusEnum.STATUS_REFUNDED.getCode();
// refundAt = DateUtil.format(response.getGmtRefundPay(), DateUtil.Formatter.yyyyMMddHHmmss);
// } else {
// refundStatus = DragonConstant.RefundStatusEnum.STATUS_REFUNDING.getCode();
// }
// sendMySqlRedis(
// SqlMapping.get("dragon_order_refund_success.update"),
// new Object[]{nowTime, refundAt, refundStatus, orderRefundId}
// );
// } catch (Exception e) {
// e.printStackTrace();
// log.error("");
// channelDto.setResult("exception");
// channelDto.setMessage("update order refund with db error: " + e.getMessage());
// contentDto.setRequest(JSON.toJSONString(response.getParams()));
// contentDto.setResponse(response.getBody());
// channelDto.setContent(contentDto);
// return channelDto;
// }
// channelDto.setResult("refunded");
// channelDto.setMessage(paymentType + " refund info: ");
// contentDto.setRequest(JSON.toJSONString(response.getParams()));
// contentDto.setResponse(response.getBody());
// channelDto.setContent(contentDto);
// return channelDto;
}
public
DragonRefundChannelDto
aliPayRefund
(
String
orderRefundId
,
String
refundCode
,
String
code
,
String
reason
,
BigDecimal
price
,
String
paymentId
,
String
paymentType
,
LocalDateTime
nowTime
)
{
String
refundStatus
;
DragonRefundChannelDto
channelDto
=
new
DragonRefundChannelDto
();
...
...
@@ -205,8 +231,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
"\"out_request_no\":\""
+
refundCode
+
"\","
+
"\"refund_reason\":\""
+
reason
+
"\","
+
"\"refund_amount\":\""
+
price
.
doubleValue
()
+
"\"}"
);
//设置业务参数
AlipayTradeRefundResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
//通过alipayClient调用API,获得对应的response类
System
.
out
.
print
(
response
.
getBody
());
AlipayTradeRefundResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
if
(
response
.
getFundChange
().
equals
(
"N"
)
||
response
.
getFundChange
()
==
null
)
{
try
{
String
refundError
=
""
;
...
...
@@ -306,8 +331,4 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return
false
;
}
}
private
void
wePayRefundCallBack
()
{
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/PayWepayUtils.java
View file @
a4c37a06
...
...
@@ -2,10 +2,12 @@ package com.liquidnet.service.dragon.utils;
import
com.alipay.api.internal.util.file.IOUtils
;
import
com.liquidnet.commons.lang.util.MD5Utils
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WePayRefundReturnDto
;
import
org.apache.http.conn.ssl.SSLConnectionSocketFactory
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.ssl.SSLContexts
;
import
org.dom4j.DocumentException
;
import
javax.net.ssl.SSLContext
;
import
java.io.ByteArrayInputStream
;
...
...
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