xiongzhu há 4 anos atrás
pai
commit
75256fb8d4

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

@@ -101,7 +101,11 @@ public class SandPayService {
 
     public JSONObject requestAlipay(String orderId, BigDecimal amount, String subject, String desc,
                                     LocalDateTime timeout, String extend) {
-
+        if (orderId.length() < 12) {
+            for (int i = orderId.length(); i < 12; i++) {
+                orderId = "0" + orderId;
+            }
+        }
         JSONObject header = new JSONObject();
         header.put("version", "1.0");            //版本号
         header.put("method", "sandpay.trade.precreate");   //接口名称:统一下单并支付