Browse Source

[支付][分账]:调整一些错误处理的记录

release_toaliyun_real
hupeng 7 years ago
parent
commit
7379155cb9
2 changed files with 8 additions and 2 deletions
  1. +6
    -2
      mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java
  2. +2
    -0
      mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingReceiverServiceImpl.java

+ 6
- 2
mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java View File

@@ -24,7 +24,8 @@ import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.simple.common.IdWorker;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


@Service
@@ -138,6 +139,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
}

@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public ResultData createSharingOrder(WxPayOrder wxPayOrder) {
final IdWorker idworker = IdWorker.get();

@@ -236,6 +238,8 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ

if (!WxPayment.verifyNotifyHMAC(returnMap,payAccount.getApiKey())){
record.setErrorMsg("返回值校验失败");
record.setUpdateTime(new Date());
wxProfitSharingOrderMapper.updateByPrimaryKey(record);
return new ResultData(ErrorCode.PROFIT_SHARING_RETURN_INVALID.getCode(), ErrorCode.PROFIT_SHARING_RETURN_INVALID.getMessage());
}

@@ -292,7 +296,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
return new ResultData(ErrorCode.PROFIT_SHARING_QUERY_REQUEST_FAILED.getCode(), returnMap.get("return_msg"));
}

if (!WxPayment.verifyNotify(returnMap,payAccount.getApiKey())){
if (!WxPayment.verifyNotifyHMAC(returnMap,payAccount.getApiKey())){
return new ResultData(ErrorCode.PROFIT_SHARING_QUERY_RETURN_INVALID.getCode(), ErrorCode.PROFIT_SHARING_RETURN_INVALID.getMessage());
}



+ 2
- 0
mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingReceiverServiceImpl.java View File

@@ -196,9 +196,11 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
if (!"SUCCESS".equals(result_code)) {
return new ResultData(ErrorCode.PROFIT_SHARING_RECEIVER_DEL_FAILED.getCode(), returnMap.get("result_msg"));
}

if (!WxPayment.verifyNotifyHMAC(returnMap,payAccount.getApiKey())){
return new ResultData(ErrorCode.PROFIT_SHARING_RECEIVER_DEL_FAILED.getCode(), ErrorCode.PROFIT_SHARING_RECEIVER_DEL_FAILED.getMessage());
}

wxProfitSharingReceiverMapper.deleteByPrimaryKey(receiver);
return new ResultData(returnMap);
}


Loading…
Cancel
Save