杨杰 4 سال پیش
والد
کامیت
86d8f212b6
2فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 3 3
      src/main/java/com/llisoft/pay/entity/App.java
  2. 3 0
      src/main/java/com/llisoft/pay/service/OrderService.java

+ 3 - 3
src/main/java/com/llisoft/pay/entity/App.java

@@ -35,7 +35,7 @@ public class App {
     /**
     /**
      * 是否测试状态(测试中支付金额为1分)
      * 是否测试状态(测试中支付金额为1分)
      */
      */
-    private Boolean debug;
+    private boolean debug;
 
 
     /**
     /**
      * 创建时间
      * 创建时间
@@ -87,11 +87,11 @@ public class App {
         this.returnUrl = returnUrl;
         this.returnUrl = returnUrl;
     }
     }
 
 
-    public Boolean getDebug() {
+    public boolean getDebug() {
         return debug;
         return debug;
     }
     }
 
 
-    public void setDebug(Boolean debug) {
+    public void setDebug(boolean debug) {
         this.debug = debug;
         this.debug = debug;
     }
     }
 
 

+ 3 - 0
src/main/java/com/llisoft/pay/service/OrderService.java

@@ -57,6 +57,9 @@ public class OrderService {
 		// 创建订单
 		// 创建订单
 		Order order = new Order();
 		Order order = new Order();
 		order.setOrderNum(orderNum);
 		order.setOrderNum(orderNum);
+		if(app.getDebug()) {
+			orderMoney = 1; // 一分钱测试
+		}
 		order.setOrderMoney(orderMoney);
 		order.setOrderMoney(orderMoney);
 		order.setOrderTitle(orderTitle); // 订单描述
 		order.setOrderTitle(orderTitle); // 订单描述
 		order.setOrderStatus(STATUS_WAIT);
 		order.setOrderStatus(STATUS_WAIT);