杨杰 il y a 4 ans
Parent
commit
86d8f212b6

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

@@ -35,7 +35,7 @@ public class App {
     /**
      * 是否测试状态(测试中支付金额为1分)
      */
-    private Boolean debug;
+    private boolean debug;
 
     /**
      * 创建时间
@@ -87,11 +87,11 @@ public class App {
         this.returnUrl = returnUrl;
     }
 
-    public Boolean getDebug() {
+    public boolean getDebug() {
         return debug;
     }
 
-    public void setDebug(Boolean debug) {
+    public void setDebug(boolean 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.setOrderNum(orderNum);
+		if(app.getDebug()) {
+			orderMoney = 1; // 一分钱测试
+		}
 		order.setOrderMoney(orderMoney);
 		order.setOrderTitle(orderTitle); // 订单描述
 		order.setOrderStatus(STATUS_WAIT);