提交代码

dev-discount
胡锐 2 years ago
parent 785b70b53d
commit 095c88d59a
  1. 3
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  2. 11
      hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java
  3. 1
      hai-service/src/main/resources/dev/commonConfig.properties

@ -451,6 +451,9 @@ public class OrderPayController {
// 支付前业务校验
orderPayBeforeService.payOrderCheck(order);
order.setAccountMerchantNum(UnionPayConfig.MER_ID3);
order.setProfitSharingStatus(false);
orderService.updateOrderData(order);
return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPayPrice(), "购买商品", SysConst.getSysConfig().getUnionPayNotifyUrl(), request));
} catch (Exception e) {

@ -184,11 +184,11 @@ public class OrderRefundServiceImpl implements OrderRefundService {
startTime.set(Calendar.SECOND, 59);
// 订单是否处于当日的订单
if (DateUtil.isEffectiveDate(order.getPayTime(), startTime.getTime(), endTime.getTime())) {
if (!DateUtil.isEffectiveDate(order.getPayTime(), startTime.getTime(), endTime.getTime())) {
// 订单撤销
JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPaySerialNo());
System.out.println(refund.toJSONString());
if (!refund.getString("resultcode").equals("00") || !refund.getString("resultcode").equals("W6")) {
if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
}
refundPriceModel.setRefundSuccess(true);
@ -196,11 +196,8 @@ public class OrderRefundServiceImpl implements OrderRefundService {
// 订单退款
JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
System.out.println(refund.toJSONString());
if (!refund.getString("resultcode").equals("00") || !refund.getString("resultcode").equals("W6")) {
JSONObject refund2 = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID1, UnionPayConfig.TERM_ID1, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
if (!refund2.getString("resultcode").equals("00") || !refund.getString("resultcode").equals("W6")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund2.getString("returnmsg"));
}
if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
}
refundPriceModel.setRefundSuccess(true);
}

@ -62,7 +62,6 @@ unionPayChannelid=D01X00000801226
unionPayMerid=83169055983W000
unionPayTermid=XS000103
unionPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notify
unionPayTelNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notifyTel
unionStagingPayUrl=https://mtest.eycard.cn/

Loading…
Cancel
Save