Commit 4c06be58 by vega

Merge branch 'feature/1.9.36-新增银联礼品卡支付-肖家炜' into develop

parents 3d1614d3 646df96d
......@@ -14,6 +14,10 @@ public class ResponseCodeConstant {
public final static String RESPONSE_SUCCESS_0_STR = "0";
public final static int RESPONSE_SUCCESS_0 = 0;
// 电子风味卡,密码错误或者余额不足,需要特殊处理
public final static String PASSWORD_WRONG = "8200407";
public final static String NOT_SUFFICIENT_FUND = "8200407";
private final static Set<Object> successResponseCodeSet = new HashSet<>();
static {
......
......@@ -2187,8 +2187,14 @@ public class OrderServiceImpl implements Orderservice {
orderPayResponse = getOrderPayResponse(paymentRequest, createPrepayRequestDto.getFatherOrderBean());
}
if (orderPayResponse == null || Objects.isNull(orderPayResponse.getFmId())) {
return failPreOrderPay(LogThreadLocal.getTrackingNo(), createPrepayRequestDto.getProductOrderBean(), cardCode, createPrepayRequestDto.getOrderClient(),
BaseResponse baseResponse = failPreOrderPay(LogThreadLocal.getTrackingNo(), createPrepayRequestDto.getProductOrderBean(), cardCode, createPrepayRequestDto.getOrderClient(),
Objects.isNull(orderPayResponse) ? null : orderPayResponse.getMsg());
// 电子风味卡需要给用户特殊的返回
if (totalAmount > 0 && Objects.nonNull(createPrepayRequestDto.getUnionPayCard()) && Objects.nonNull(orderPayResponse) &&
(ResponseCodeConstant.PASSWORD_WRONG.equals(orderPayResponse.getPayTransId()) || ResponseCodeConstant.NOT_SUFFICIENT_FUND.equals(orderPayResponse.getPayTransId()))) {
baseResponse.setMessage(orderPayResponse.getMsg());
}
return baseResponse;
}
createOrderResponse = orderAdapter.convent2CreateFatherSonOrderResponseVo(orderPayResponse, createPrepayRequestDto.getProductOrderBean());
BaseResponse baseEditResponse = this.updateOrderInfo(orderPayResponse, createPrepayRequestDto.getOrderExtInfoDTO(), createPrepayRequestDto.getProductOrderBean(), LogThreadLocal.getTrackingNo());
......@@ -2252,6 +2258,10 @@ public class OrderServiceImpl implements Orderservice {
request.setVer("2");
com.freemud.application.sdk.api.base.BaseResponse<CodePayResponse> responseBase = paymentNewService.codePay(request, trackingNo);
if (responseBase == null || !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode()) || responseBase.getData().getData() == null) {
// 需要把2种特殊情况抛给用户
if (Objects.nonNull(responseBase) && (ResponseCodeConstant.PASSWORD_WRONG.equals(responseBase.getCode()) || ResponseCodeConstant.NOT_SUFFICIENT_FUND.equals(responseBase.getCode()))) {
orderPayResponse.setPayTransId(responseBase.getCode());
}
orderPayResponse.setMsg(Objects.isNull(responseBase) ? "电子风味卡支付异常" : responseBase.getMessage());
} else {
CodePayResponse.CodePayDate codePayResponse = responseBase.getData().getData();
......@@ -2657,8 +2667,14 @@ public class OrderServiceImpl implements Orderservice {
if(createOrderVo.getFaceCode() != null){
createOrderVo.setCardCode(createOrderVo.getFaceCode());
}
return failPreOrderPay(LogThreadLocal.getTrackingNo(), productOrderBean, createOrderVo.getCardCode(), null,
BaseResponse baseResponse = failPreOrderPay(LogThreadLocal.getTrackingNo(), productOrderBean, createOrderVo.getCardCode(), null,
Objects.isNull(orderPayResponse) ? null : orderPayResponse.getMsg());
// 电子风味卡需要给用户特殊的返回
if (totalAmount > 0 && Objects.nonNull(createOrderVo.getUnionPayCard()) && Objects.nonNull(orderPayResponse) &&
(ResponseCodeConstant.PASSWORD_WRONG.equals(orderPayResponse.getPayTransId()) || ResponseCodeConstant.NOT_SUFFICIENT_FUND.equals(orderPayResponse.getPayTransId()))) {
baseResponse.setMessage(orderPayResponse.getMsg());
}
return baseResponse;
}
//更新订单extinfo信息
BaseResponse baseEditResponse = this.updateOrderInfo(orderPayResponse, orderExtInfoDTO, productOrderBean, LogThreadLocal.getTrackingNo());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment