You've already forked FrameTour-BE
feat(profit-share): 实现分账消息发送功能
- 修改 ProfitShareKafkaProducer 的 sendRefundMessage 方法返回 CompletableFuture - 在 WxMpPayAdapter 中增加 transactionId 和 refundTransactionId 字段解析 - 在 PayResponse 和 RefundResponse 中新增 transactionId 相关字段 - 在 WxPayServiceImpl 中注入 ProfitShareKafkaProducer 并发送分账消息 - 调整退款逻辑以异步方式发送分账退款消息后再执行退款操作
This commit is contained in:
@@ -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) {
|
||||
//退款成功
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user