wangqifan %!s(int64=3) %!d(string=hai) anos
pai
achega
d56344de2e

+ 1 - 1
src/main/java/cn/com/sandpay/cashier/sdk/CertUtil.java

@@ -92,7 +92,7 @@ public class CertUtil {
 			InputStream inputStream = null;
 			if (privateKeyPath.startsWith(classpathKey)) {
 				inputStream = CertUtil.class.getClassLoader()
-						.getResourceAsStream(privateKeyPath.substring(classpathKey.length()));
+						.getResourceAsStream("cert/0424.pfx");
 			} else {
 				inputStream = new FileInputStream(privateKeyPath);
 			}

+ 2 - 2
src/main/resources/application.yaml

@@ -223,8 +223,8 @@ adapay:
 sandpay:
   url: https://cashier.sandpay.com.cn/qr/api
   mid: 6888803044895
-  sign-cert-path: classpath:cert/siyao.pfx
-  sign-cert-pwd: lasuo0424
+  sign-cert-path: classpath:cert/0424.pfx
+  sign-cert-pwd: 220424
   sand-cert-path: classpath:cert/sand.cer
   notify-url: https://test.adcs.vip/sandpay/notify
 rocketmq:

BIN=BIN
src/main/resources/cert/0424.pfx


BIN=BIN
src/main/resources/cert/623.pfx


BIN=BIN
src/main/resources/cert/lasuo.pfx


+ 20 - 14
src/test/java/com/izouma/nineth/service/OrderServiceTest.java

@@ -49,6 +49,8 @@ public class OrderServiceTest extends ApplicationTests {
     private CollectionService collectionService;
     @Autowired
     private BlindBoxItemRepo  blindBoxItemRepo;
+    @Autowired
+    private SandPayService    sandPayService;
 
     @Test
     public void create() {
@@ -186,21 +188,21 @@ public class OrderServiceTest extends ApplicationTests {
         orderRepo.findByCollectionId(8012L).stream()
                 .filter(o -> o.getStatus() == OrderStatus.FINISH || o.getStatus() == OrderStatus.PROCESSING)
                 .parallel().forEach(order -> {
-                    List<Asset> assets = assetRepo.findByOrderId(order.getId());
-                    if (assets.size() > 1) {
-                        assets.sort(Comparator.comparing(BaseEntity::getCreatedAt));
-                        for (int i = 1; i < assets.size(); i++) {
-                            assetRepo.delete(assets.get(i));
-                            tokenHistoryRepo.deleteByTokenId(assets.get(i).getTokenId());
-                            if (assets.get(i).getPublicCollectionId() != null) {
-                                collectionRepo.findById(assets.get(i).getPublicCollectionId()).ifPresent(c -> {
-                                    collectionRepo.delete(c);
-                                });
-                            }
-                        }
-                        ids.add(order.getId());
+            List<Asset> assets = assetRepo.findByOrderId(order.getId());
+            if (assets.size() > 1) {
+                assets.sort(Comparator.comparing(BaseEntity::getCreatedAt));
+                for (int i = 1; i < assets.size(); i++) {
+                    assetRepo.delete(assets.get(i));
+                    tokenHistoryRepo.deleteByTokenId(assets.get(i).getTokenId());
+                    if (assets.get(i).getPublicCollectionId() != null) {
+                        collectionRepo.findById(assets.get(i).getPublicCollectionId()).ifPresent(c -> {
+                            collectionRepo.delete(c);
+                        });
                     }
-                });
+                }
+                ids.add(order.getId());
+            }
+        });
         System.out.println(ids);
     }
 
@@ -260,5 +262,9 @@ public class OrderServiceTest extends ApplicationTests {
                 Arrays.asList(OrderStatus.FINISH, OrderStatus.NOT_PAID, OrderStatus.PROCESSING)));
     }
 
+    @Test
+    public void test3() {
+        sandPayService.payOrder(989544769111719936L);
+    }
 
 }