zhuyifan

fix(pay): 优化支付回调交易ID更新逻辑

...@@ -39,6 +39,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -39,6 +39,7 @@ import lombok.extern.slf4j.Slf4j;
39 import org.apache.commons.codec.binary.Base64; 39 import org.apache.commons.codec.binary.Base64;
40 import org.apache.commons.codec.digest.DigestUtils; 40 import org.apache.commons.codec.digest.DigestUtils;
41 import org.apache.commons.collections4.CollectionUtils; 41 import org.apache.commons.collections4.CollectionUtils;
42 +import org.apache.commons.lang3.StringUtils;
42 import org.springframework.beans.factory.annotation.Autowired; 43 import org.springframework.beans.factory.annotation.Autowired;
43 import org.springframework.http.HttpEntity; 44 import org.springframework.http.HttpEntity;
44 import org.springframework.http.HttpHeaders; 45 import org.springframework.http.HttpHeaders;
...@@ -201,8 +202,8 @@ public class PayServiceClient { ...@@ -201,8 +202,8 @@ public class PayServiceClient {
201 .setPayStatus(PayStatusEnum.SUCCEED) 202 .setPayStatus(PayStatusEnum.SUCCEED)
202 .setShouldUpdateStatus(true) 203 .setShouldUpdateStatus(true)
203 .setStatus(OrderStatusEnum.PREPARING) 204 .setStatus(OrderStatusEnum.PREPARING)
204 - .setShouldUpdateTransactionId(true) 205 + .setShouldUpdateTransactionId(StringUtils.isNotEmpty(paymentCallbackResult.getTradeReferenceNo()))
205 - .setTransactionId(paymentCallbackResult.getTradeReferenceNo()) 206 + .setTransactionId(StringUtils.isNotEmpty(paymentCallbackResult.getTradeReferenceNo()) ? paymentCallbackResult.getTradeReferenceNo() : "")
206 .build(); 207 .build();
207 final var updateResponse = 208 final var updateResponse =
208 orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); 209 orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build);
......