fix:小程序退款及公众号推送消息+配置回调地址

This commit is contained in:
lhb 2025-04-30 16:36:25 +08:00
parent f10bbd184e
commit 25d0c60809
2 changed files with 22 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package com.evotech.hd.cloud.controller.order;
import java.util.List;
import com.evotech.hd.common.core.entity.cloud.request.PrePayRequest;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -71,4 +72,23 @@ public class TradeController {
return tradeService.wechatPayNotifyHandle(tradeDetail);
}
@Operation(summary = "退款查询")
@GetMapping("/tradeList")
@ApiOperationSupport(order = 6)
public List<TradeDetail> tradeList(@ParameterObject PrePayRequest preltr) {
PageListTradeRequest pltr2 = new PageListTradeRequest();
pltr2.setWuid(preltr.getWuid());
pltr2.setPayType(preltr.getPayType());
pltr2.setTradeType(preltr.getTradeType());
return tradeService.tradeList(pltr2);
}
@Operation(summary = "微信退款余额回调业务处理")
@PostMapping({"/wechatpay/backnotify"})
@ApiOperationSupport(order = 7)
@Hidden
public Result<String> wechatBackNotifyHandle(@ParameterObject TradeDetail tradeDetail) {
return tradeService.wechatBackNotifyHandle(tradeDetail);
}
}

View File

@ -218,8 +218,8 @@ public class WechatPayServiceImpl implements WechatPayService {
request.setTransactionId(transactionId);
request.setReason(reason);
request.setOutRefundNo("HD1001REFUND" + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_FORMATTER) + RandomUtil.randomInt(1000, 10000));
// request.setNotifyUrl(xcxProperties.getRefundNotifyUrl());
request.setNotifyUrl("https://www.famhub.cn/gateway/wechat/wechatpay/refundsback/msg");
request.setNotifyUrl(xcxProperties.getRefundNotifyUrl());
// request.setNotifyUrl("https://www.famhub.cn/gateway/wechat/wechatpay/refundsback/msg");
AmountReq amount = new AmountReq();
amount.setRefund(Long.valueOf(money));
amount.setCurrency("CNY");