소스 검색

fix原生支付流程调整

Eric 1 년 전
부모
커밋
9fbc55c3df
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentCoreServiceImpl.java

+ 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);