feat(profit-share): 实现分账消息发送功能

- 修改 ProfitShareKafkaProducer 的 sendRefundMessage 方法返回 CompletableFuture
- 在 WxMpPayAdapter 中增加 transactionId 和 refundTransactionId 字段解析
- 在 PayResponse 和 RefundResponse 中新增 transactionId 相关字段
- 在 WxPayServiceImpl 中注入 ProfitShareKafkaProducer 并发送分账消息
- 调整退款逻辑以异步方式发送分账退款消息后再执行退款操作
This commit is contained in:
2025-12-16 17:58:20 +08:00
parent a9555d612a
commit a9c33352f7
5 changed files with 48 additions and 19 deletions

View File

@@ -200,6 +200,7 @@ public class WxMpPayAdapter implements IPayAdapter {
Transaction parse = parser.parse(requestParam, Transaction.class);
resp.setValid(true);
resp.setOrderNo(parse.getOutTradeNo());
resp.setTransactionId(parse.getTransactionId());
if (parse.getAmount() != null) {
resp.setOrderPrice(parse.getAmount().getTotal());
resp.setPayPrice(parse.getAmount().getPayerTotal());
@@ -313,6 +314,7 @@ public class WxMpPayAdapter implements IPayAdapter {
.build();
RefundNotification parse = parser.parse(requestParam, RefundNotification.class);
resp.setValid(true);
resp.setRefundTransactionId(parse.getRefundId());
resp.setOriginalResponse(parse);
if (parse.getRefundStatus() == SUCCESS) {
//退款成功

View File

@@ -9,6 +9,7 @@ import java.math.BigDecimal;
public class PayResponse {
private boolean valid;
private String orderNo;
private String transactionId;
@JsonIgnore
private Object originalResponse;
private Integer orderPrice;

View File

@@ -10,6 +10,7 @@ public class RefundResponse {
private boolean valid;
private String orderNo;
private String refundNo;
private String refundTransactionId;
@JsonIgnore
private Object originalResponse;
private Integer orderPrice;