| | |
| | | remoteActivityService.changeActivityTotal(activityTotalChangeDto); |
| | | } |
| | | |
| | | log.info("用户取消订单退款, 检查退款"); |
| | | // 用户取消订单退款 |
| | | BigDecimal onlinePayMoney = order.getOnlinePayMoney(); |
| | | if(BigDecimal.ZERO.compareTo(onlinePayMoney) < 0){ |
| | | log.info("订单支付金额大于0,可发起退款"); |
| | | // 订单支付金额大于0,可发起退款 |
| | | orderWxApplyRefund(orderId, refundId, onlinePayMoney, orderRefund); |
| | | } |
| | |
| | | if (null == orderPayment) { |
| | | return; |
| | | } |
| | | |
| | | log.info("调用微信退款---发起退款"); |
| | | |
| | | String subMchId = orderPayment.getSubMchId(); |
| | | WxPayConfig config = wxService.getConfig(); |
| | | |
| | |
| | | request.setOutRefundNo(outRefundNo); |
| | | request.setReason("用户取消订单"); |
| | | // 订单金额 |
| | | int total = payMoney.multiply(new BigDecimal(100)).intValue(); |
| | | int total = orderPayment.getPayMoney().multiply(new BigDecimal(100)).intValue(); |
| | | |
| | | RefundsRequest.Amount amount = RefundsRequest.Amount.builder().refund(total).total(total).currency("CNY").build(); |
| | | request.setAmount(amount); |
| | | request.setNotifyUrl(config.getNotifyUrl()); |
| | |
| | | // 返回参数 |
| | | String refundResponseJson = gson.toJson(result); |
| | | |
| | | log.info("调用微信退款返回参数---{}", refundResponseJson); |
| | | |
| | | // 保存支付订单统一下单日志 |
| | | paymentMessageService.savePaymentMessage("3", orderId, refundRequestJson, refundResponseJson); |
| | | |