退款接口实现

This commit is contained in:
SongZhang 2024-10-08 10:51:24 +08:00
parent 27f489fb0f
commit fbb2be3755
2 changed files with 4 additions and 4 deletions

View File

@ -99,12 +99,12 @@ public class PayServiceImpl implements PayService {
returnOrderInfo.getRefundAmount().setScale(2, RoundingMode.DOWN).multiply(new BigDecimal(100)).longValue(), callBack, null, thirdApply.getAppToken());
log.info("福商通退款响应报文: {}", publicResp);
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
if (!"000000".equals(publicResp.getCode())) {
if ("000000".equals(publicResp.getCode())) {
if (!"SUCCESS".equals(publicResp.getObjData().getState()) && !publicResp.getObjData().getState().equals("ING")) {
throw new BadRequestException("退款渠道调用失败");
throw new BadRequestException("退款渠道调用失败: " + publicResp.getMsg());
}
} else {
throw new BadRequestException("退款渠道调用失败");
throw new BadRequestException("退款渠道调用失败: " + publicResp.getMsg());
}
}
}

View File

@ -99,7 +99,7 @@ public class ThirdPayService {
param.setSign(sign);
String reqbody = JSONUtil.toJSONString(param);
log.info("请求参数:{}", reqbody);
String response = HttpRequest.post(url.concat(trade)).body(reqbody).execute().body();
String response = HttpRequest.post(url.concat(refund)).body(reqbody).execute().body();
log.info("返回结果:{}", response);
PublicResp<OrderReturnResp> resp =JSONUtil.parseJSONStr2T(response,PublicResp.class);
resp.setObjData(JSONUtil.parseJSONStr2T(resp.getBizData(),OrderReturnResp.class));