|
|
@@ -32,6 +32,7 @@ import java.util.Optional;
|
|
|
public class OrderPayService {
|
|
|
private static String PAY_CHANNEL = "sandPay";
|
|
|
|
|
|
+ private final OrderService orderService;
|
|
|
private final OrderRepo orderRepo;
|
|
|
private final MintOrderRepo mintOrderRepo;
|
|
|
private final GiftOrderRepo giftOrderRepo;
|
|
|
@@ -125,7 +126,17 @@ public class OrderPayService {
|
|
|
}
|
|
|
|
|
|
public void confirmOrderAgreement(String requestId, String paymentOrderId, String code) {
|
|
|
- payEaseService.payConfirm(requestId, paymentOrderId, code);
|
|
|
+ try {
|
|
|
+ payEaseService.payConfirm(requestId, paymentOrderId, code);
|
|
|
+ } catch (BusinessException e) {
|
|
|
+ try {
|
|
|
+ new Thread(() -> {
|
|
|
+ orderService.cancel(Long.parseLong(requestId));
|
|
|
+ }).start();
|
|
|
+ } catch (Exception ee) {
|
|
|
+ }
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Cacheable(value = "payOrder", key = "'gift#'+#orderId")
|