Explorar o código

fix原生支付流程调整

Eric hai 1 ano
pai
achega
9fbc55c3df

+ 8 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentCoreServiceImpl.java

@@ -501,9 +501,16 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
     public UserPaymentOrderWrapper.PaymentConfig executeOrder(UserPaymentOrderWrapper.UserPaymentOrder orderReq) {
 
         // 填充订单基本信息
+        String defaultService = paymentServiceContext.defaultService();
+        if (EPayerType.ORIGINAL.getCode().toLowerCase().equals(defaultService)) {
+            // 原生支付需要传入支付三方渠道
+            if (StringUtils.isEmpty(orderReq.getPaymentType())) {
+                throw new BizException("支付三方渠道不能为空");
+            }
+        }
         orderReq
             .orderNo(IdWorker.getIdStr())
-            .paymentVender(Optional.ofNullable(orderReq.getPaymentType()).orElse(paymentServiceContext.getPaymentService().venderName()))
+            .paymentVender(Optional.ofNullable(orderReq.getPaymentType()).orElse(defaultService))
             .paymentChannel("")
             .status(EPaymentStatus.WAIT_PAY)
             .originalPrice(BigDecimal.ZERO);