Browse Source

[退款回调][新增]:微信退款回调接口

release_toaliyun_real
Stormeye.Wu 7 years ago
parent
commit
37cfebf330
2 changed files with 24 additions and 20 deletions
  1. +7
    -7
      mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java
  2. +17
    -13
      mallinkService/src/main/java/com/simple/service/impl/WxRefundOrderServiceImpl.java

+ 7
- 7
mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java View File

@@ -262,13 +262,13 @@ public class WxPayOrderServiceImpl implements WxPayOrderService {
Date currentDate = new Date();
// 修改支付订单状态
try {
WxPayOrder updatePayOrder = new WxPayOrder();
updatePayOrder.setId(record.getId());
updatePayOrder.setOrderId(record.getOrderId());
updatePayOrder.setUpdateTime(currentDate);
updatePayOrder.setPayOrderStatus(EnumPayStatus.PAY_WAY_SUCCESS.getCode());
updatePayOrder.setTransactionId(transactionId);
wxPayOrderMapper.updateByPrimaryKeySelective(updatePayOrder);
WxPayOrder updateOrder = new WxPayOrder();
updateOrder.setId(record.getId());
updateOrder.setOrderId(record.getOrderId());
updateOrder.setUpdateTime(currentDate);
updateOrder.setPayOrderStatus(EnumPayStatus.PAY_WAY_SUCCESS.getCode());
updateOrder.setTransactionId(transactionId);
wxPayOrderMapper.updateByPrimaryKeySelective(updateOrder);
} catch (Exception e) {
logger.error(e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL);


+ 17
- 13
mallinkService/src/main/java/com/simple/service/impl/WxRefundOrderServiceImpl.java View File

@@ -18,6 +18,7 @@ import com.simple.mapper.*;
import com.simple.pay.WxPay;
import com.simple.pay.WxPayment;
import com.simple.pay.WxRefundOrderP;
import com.simple.service.WxOrderService;
import com.simple.service.WxRefundOrderService;
import com.simple.utils.BeanUtils;
import com.simple.utils.Utility;
@@ -48,6 +49,9 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
@Autowired
WxPayAccountMapper wxPayAccountMapper;

@Autowired
WxOrderService wxOrderService;

JSONObject errorRefundReqMap = JSON.parseObject("{\n" +
" \"SYSTEMERROR\": {\n" +
" \"detail\": \"接口返回错误\",\n" +
@@ -433,23 +437,24 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
"is paid success , orderId : " + refundOrder.getOrderId());
return;
}
/*
WxOrder order = wxRefundOrderMapper.selectByPrimaryKey(record.getOrderId());
WxOrder order = wxOrderMapper.selectByPrimaryKey(refundOrder.getOrderId());
if (order == null) {
logger.error("pay success handle, order " + record.getOrderId() +" not found , payOrderGid : " + record.getPayOrderNo());
logger.error("pay success handle, order " + refundOrder.getOrderId() +" not found , refundId : " + refundOrder.getId());
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND);
}

Date currentDate = new Date();
// 修改支付订单状态
// 修改退款订单状态
try {
WxPayOrder updatePayOrder = new WxPayOrder();
updatePayOrder.setId(record.getId());
updatePayOrder.setOrderId(record.getOrderId());
updatePayOrder.setUpdateTime(currentDate);
updatePayOrder.setPayOrderStatus(EnumPayStatus.PAY_WAY_SUCCESS.getCode());
updatePayOrder.setTransactionId(transactionId);
wxPayOrderMapper.updateByPrimaryKeySelective(updatePayOrder);
WxRefundOrder updateOrder = new WxRefundOrder();
updateOrder.setId(refundOrder.getId());
updateOrder.setOrderId(refundOrder.getOrderId());
updateOrder.setUpdateTime(currentDate);
updateOrder.setRefundOrderStatus(EnumRefundStatus.REFUND_SUCCESS.getCode());
updateOrder.setTransactionId(transactionId);
updateOrder.setRefundId(refundId);
wxRefundOrderMapper.updateByPrimaryKeySelective(updateOrder);
} catch (Exception e) {
logger.error(e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL);
@@ -457,12 +462,11 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {

// 修改订单状态
try {
wxOrderService.updateOrderStatus(order.getId(), EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS);
wxOrderService.updateOrderStatus(order.getId(), EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS);
} catch (Exception e) {
logger.error(e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL);
}
*/
/*
Map<String, String> msgMap = new HashMap<>();
try {


Loading…
Cancel
Save