lyhzzz 2 лет назад
Родитель
Сommit
ed22f61560

+ 1 - 11
src/main/java/com/fdkankan/pay/entity/AutopayPlan.java

@@ -57,15 +57,5 @@ public class AutopayPlan implements Serializable {
 
 
 
-    public AutopayPlan(Order order, String productId,String planId) {
-        if(order != null){
-            this.serveId = order.getServeId();
-            this.orderType = order.getOrderType();
-            this.payType = order.getPayType();
-            this.orderMoney = order.getOrderMoney();
-            this.autoPayTime = order.getAutoPayTime();
-        }
-        this.productId = productId;
-        this.planId = planId;
-    }
+
 }

+ 12 - 0
src/main/java/com/fdkankan/pay/service/impl/AutopayPlanServiceImpl.java

@@ -29,4 +29,16 @@ public class AutopayPlanServiceImpl extends ServiceImpl<IAutopayPlanMapper, Auto
         wrapper.eq(AutopayPlan::getAutoPayTime,order.getAutoPayTime());
         return this.getOne(wrapper);
     }
+    public getAutopayPlan(Order order, String productId,String planId) {
+        if(order != null){
+            this.serveId = order.getServeId();
+            this.orderType = order.getOrderType();
+            this.payType = order.getPayType();
+            this.orderMoney = order.getOrderMoney();
+            this.autoPayTime = order.getAutoPayTime();
+        }
+        this.productId = productId;
+        this.planId = planId;
+    }
+
 }

+ 8 - 1
src/main/java/com/fdkankan/pay/util/paypal/sdk/PaypalService.java

@@ -474,7 +474,14 @@ public class PaypalService {
             String planId = restApiPaypalService.createPlan(paypalConfig, plan);
             log.info("创建订阅计划:"+planId);
 
-            autopayPlan = new AutopayPlan(order,productId,planId);
+            autopayPlan = new AutopayPlan();
+            autopayPlan.setServeId(order.getServeId());
+            autopayPlan.setAutoPayTime(order.getAutoPayTime());
+            autopayPlan.setOrderType(order.getOrderType());
+            autopayPlan.setPayType(order.getPayType());
+            autopayPlan.setOrderMoney(order.getOrderMoney());
+            autopayPlan.setProductId(productId);
+            autopayOrder.setPlanId(planId);
             autopayPlanService.save(autopayPlan);
         }