TRX 1 年間 前
コミット
fc3f0e3277

+ 3 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/payment/CreateOrderParam.java

@@ -49,6 +49,9 @@ public class CreateOrderParam {
     @Schema(description = "消费金额(Mode为2时,此字段传入值可能为0)")
     private String amount;
 
+    @Schema(description = "是否指定支付渠道")
+    private Boolean appointPaymentType = Boolean.FALSE;
+
     @Schema(description = "支付方式")
     private PaymentType paymentType;
 

+ 1 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/payment/OrderController.java

@@ -51,7 +51,7 @@ public class OrderController {
     @Operation(summary = "开始支付订单")
     @RequestMapping(value = {"payOrder"}, method = {RequestMethod.POST})
     public ResultContent payOrder(@RequestBody IDParam param) {
-        return expenseFlowService.initOrderPay(param.getId());
+        return expenseFlowService.initSurePaymentTypeOrderPay(param.getId());
     }
 
     @ResourceAuth(value = "user", type = AuthType.User)

+ 3 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/payment/ExpenseFlow.java

@@ -62,6 +62,9 @@ public class ExpenseFlow extends SuperMain {
     @Schema(description = "订单计费方式")
     private ChargeableType chargeableType = ChargeableType.Specified;
 
+    @Schema(description = "是否指定支付渠道")
+    private Boolean appointPaymentType = Boolean.FALSE;
+
     @Indexed
     @Schema(description = "支付方式")
     private PaymentType paymentType;

+ 4 - 9
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/payment/ExpenseFlowServiceImpl.java

@@ -388,12 +388,12 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
     }
 
     /**
-     * 开始支付订单(主要是检查订单是否可以支付)
+     * 开始支付订单,封装支付参数(如:微信支付)
      *
      * @param id
      * @return
      */
-    public ResultContent initOrderPay(String id) {
+    public ResultContent initSurePaymentTypeOrderPay(String id) {
         ExpenseFlow expenseFlow = expenseFlowDao.findTopById(id);
         if (ObjectUtils.isEmpty(expenseFlow)) {
             return ResultContent.buildFail("订单不存在");
@@ -403,14 +403,9 @@ public class ExpenseFlowServiceImpl extends SuperService implements ExpenseFlowS
             return ResultContent.buildFail(orderPayModel.getPayMsg());
         }
 
-        // 调用支付
-        ResultContent<ExpenseFlow> resultContent = payCallService.payOrder(expenseFlow);
-        expenseFlow = resultContent.getContent();
+        // 组装支付参数
+
 
-        // 支付失败
-        if (expenseFlow.getIsPaySuccess() == null || !resultContent.isSuccess()) {
-            return ResultContent.buildFail(expenseFlow.getPaymentStatus());
-        }
         return ResultContent.buildSuccess();
     }
 

+ 5 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/payment/OrderService.java

@@ -3,6 +3,7 @@ package com.zhongshu.card.server.core.service.payment;
 import com.github.microservice.models.type.OrderFromType;
 import com.github.microservice.net.ResultContent;
 import com.github.microservice.types.payment.ChargeableType;
+import com.github.microservice.types.payment.PaymentType;
 import com.zhongshu.card.client.model.devices.order.DeviceQrCodeParam;
 import com.zhongshu.card.client.model.payment.CreateOrderParam;
 import com.zhongshu.card.server.core.dao.devices.DeviceInfoDao;
@@ -86,6 +87,10 @@ public class OrderService extends SuperService {
         // 是否是浮动计费 计费方式
         orderParam.setChargeableType(ChargeableType.Specified);
 
+        // 指定支付方式
+        orderParam.setAppointPaymentType(Boolean.TRUE);
+        orderParam.setPaymentType(PaymentType.WeChatPay);
+
         ResultContent<ExpenseFlow> content = expenseFlowService.createOrder(orderParam, expenseFlow);
         expenseFlow = expenseFlowService.saveInfo(expenseFlow);
         if (!expenseFlow.getVerifyParamIsSuccess()) {

+ 2 - 2
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/payment/PayCallService.java

@@ -63,7 +63,7 @@ public class PayCallService extends SuperService {
     private BalancePayService balancePayService;
 
     @Autowired
-    ExpenseFlowDao expenseFlowDao;
+    private ExpenseFlowDao expenseFlowDao;
 
     @Autowired
     private PaymentProcessDao paymentProcessDao;
@@ -93,7 +93,7 @@ public class PayCallService extends SuperService {
     private ProjectMainPaySettingService projectMainPaySettingService;
 
     /**
-     * 统一调用支付服务
+     * 统一调用支付服务 (无感方式,直接后台 扣款)
      *
      * @param entity
      * @return