xiongzhu 4 лет назад
Родитель
Сommit
92038f82a4

+ 1 - 1
src/main/java/com/izouma/nineth/service/GiftOrderService.java

@@ -178,7 +178,7 @@ public class GiftOrderService {
                 .userId(userId)
                 .assetId(assetId)
                 .toUserId(toUserId)
-                .gasPrice(sysConfigService.getBigDecimal("gas_fee"))
+                .gasPrice(sysConfigService.getBigDecimal("gift_gas_fee"))
                 .status(OrderStatus.NOT_PAID)
                 .build();
         return giftOrderRepo.save(giftOrder);

+ 12 - 1
src/main/java/com/izouma/nineth/service/OrderPayService.java

@@ -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")

+ 1 - 1
src/main/java/com/izouma/nineth/service/PayEaseService.java

@@ -102,7 +102,7 @@ public class PayEaseService {
         if (!"SUCCESS".equals(status)) {
             String error = responseData.getString("error");
             String cause = responseData.getString("cause");
-            throw new BusinessException(error);
+            throw new BusinessException(error + "[" + cause + "]");
         }
         String bindStatus = responseData.getString("bindStatus");
         if (!"SUCCESS".equals(bindStatus)) {

+ 1 - 1
src/main/java/com/izouma/nineth/service/UserService.java

@@ -564,7 +564,7 @@ public class UserService {
     public void verifyTradeCode(Long userId, String tradeCode) {
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
         if (!passwordEncoder.matches(tradeCode, user.getTradeCode())) {
-            throw new BusinessException("校验失败");
+            throw new BusinessException("交易密码错误");
         }
     }
 

+ 15 - 0
src/main/resources/static/return.html

@@ -0,0 +1,15 @@
+<!doctype html>
+<html lang="zh">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>订单已完成</title>
+</head>
+<body>
+<div>
+    订单已完成,请返回APP查看
+</div>
+</body>
+</html>