TRX 1 gadu atpakaļ
vecāks
revīzija
056a7b1b3e

+ 6 - 2
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/payConfig/FrictionlessUnionConfig.java → FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/payConfig/FrictionlessUnionConfigModel.java

@@ -1,5 +1,6 @@
 package com.zhongshu.card.client.model.paySetting.payConfig;
 
+import com.zhongshu.card.client.model.paySetting.paySetting.PayConfigParam;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -16,12 +17,12 @@ import lombok.NoArgsConstructor;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
-public class FrictionlessUnionConfig {
+public class FrictionlessUnionConfigModel {
 
     //----------------------------业务信息 start-----------------
 
     @Schema(description = "商户号")
-    private String mid;
+    private String mchId;
 
     @Schema(description = "无感支付签约状态通知地址")
     private String notifyUrl = "";
@@ -50,6 +51,9 @@ public class FrictionlessUnionConfig {
     @Schema(description = "签约结束后调整小程序id")
     private String mchntWxMpAppId;
 
+    @Schema(description = "商户订单号固定开头")
+    private String orderStart = "";
+
     @Schema(description = "订单交易过期时间")
     private Long expireTime = 30 * 60 * 1000L;
 

+ 74 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/payConfig/FrictionlessUnionConfigParam.java

@@ -0,0 +1,74 @@
+package com.zhongshu.card.client.model.paySetting.payConfig;
+
+import com.zhongshu.card.client.model.paySetting.paySetting.PayConfigParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 项目的  银联无感支付的配置  银联配置
+ *
+ * @author TRX
+ * @date 2024/9/25
+ */
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class FrictionlessUnionConfigParam extends PayConfigParam {
+
+    //----------------------------业务信息 start-----------------
+
+    @Schema(description = "无感支付签约状态通知地址")
+    private String notifyUrl = "";
+
+    @Schema(description = "支付结果通知地址")
+    private String payNotifyUrl = "";
+
+    @Schema(description = "无感支付 秘钥 测试环境通知加密密钥")
+    private String notifySecret;
+
+    @Schema(description = "银联分配的appId")
+    private String appId;
+
+    @Schema(description = "银联分配的appKey")
+    private String appKey;
+
+    @Schema(description = "终端号")
+    private String tid;
+
+    @Schema(description = "银联无感支付签约模板ID")
+    private String planId;
+
+    @Schema(description = "来源编号")
+    private String msgSrcId;
+
+    @Schema(description = "签约结束后调整小程序id")
+    private String mchntWxMpAppId;
+
+    @Schema(description = "商户订单号固定开头")
+    private String orderStart = "";
+
+    @Schema(description = "订单交易过期时间")
+    private Long expireTime = 30 * 60 * 1000L;
+
+    //-------------------------提现 参数配置 start ------------------
+
+    @Schema(description = "悦融益提现 appId")
+    private String withdrawAppId = "";
+
+    @Schema(description = "悦融益提现 appKey")
+    private String withdrawAppKey = "";
+
+    @Schema(description = "悦融益提现 系统编号")
+    private String withdrawSysid = "";
+
+    @Schema(description = "悦融益提现 多应用类型")
+    private String withdrawAppType = "74";
+
+    @Schema(description = "悦融益提现 通知地址")
+    private String withdrawNotify;
+
+}

+ 1 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/paySetting/ProjectMainPaySettingController.java

@@ -19,7 +19,7 @@ import javax.validation.Valid;
 import java.util.List;
 
 /**
- * 项目的配置
+ * 项目的配置 (结算、提现、分账)
  *
  * @author TRX
  * @date 2024/7/26

+ 1 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/paySetting/ProjectPaySettingController.java

@@ -46,6 +46,7 @@ public class ProjectPaySettingController {
 
     @Autowired
     private ProjectPaySettingServiceImpl projectPaySettingService;
+    
 
     //------------------------------------------------机构支付参数配置 start-----------------------
 

+ 4 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectMainPaySettingService.java

@@ -62,6 +62,9 @@ public class ProjectMainPaySettingService extends SuperService {
         if (ObjectUtils.isEmpty(orgPaySettingInfo)) {
             return ResultContent.buildFail("主账号数据不存在");
         }
+        if (orgPaySettingInfo.getIsDefault() == null || !orgPaySettingInfo.getIsDefault()) {
+            return ResultContent.buildFail("选择的不是主账户类型");
+        }
 
         ProjectMainPaySetting mainPaySetting = projectMainPaySettingDao.findTopByProjectOid(param.getProjectOid());
         if (ObjectUtils.isEmpty(mainPaySetting)) {
@@ -76,7 +79,7 @@ public class ProjectMainPaySettingService extends SuperService {
         mainPaySetting.setPaymentChannelType(orgPaySettingInfo.getPaymentChannelType());
 
         projectMainPaySettingDao.save(mainPaySetting);
-        // 加入定时任务
+        // 加入结算定时任务
         scheduleTaskConfigService.initProjectSettlementRulesTask(mainPaySetting);
         return ResultContent.buildSuccess();
     }

+ 13 - 3
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectPaySettingServiceImpl.java

@@ -146,7 +146,9 @@ public class ProjectPaySettingServiceImpl extends SuperService {
             return ResultContent.buildFail(content.getMsg());
         }
         ProjectOrgPaySettingInfo settingInfo = content.getContent();
-
+        if (StringUtils.isEmpty(param.getNotifyUrl())) {
+            param.setNotifyUrl(param.getNotifyUrl().trim());
+        }
         //TODO 检查微信支付参数等
         WxPayConfigModel configModel = null;
         if (settingInfo.getPayConfig() != null) {
@@ -157,6 +159,7 @@ public class ProjectPaySettingServiceImpl extends SuperService {
         }
         BeanUtils.copyProperties(param, configModel);
 
+        // 证书文件
         MultipartFile privateKeyFile = param.getPrivateKeyFile();
         String privateKeyStr = AesUtils.turnMultipartFileToString(privateKeyFile);
         if (StringUtils.isNotEmpty(privateKeyStr)) {
@@ -436,11 +439,14 @@ public class ProjectPaySettingServiceImpl extends SuperService {
         ProjectOrgPaySettingInfo entity = projectPaySettingInfoDao.findTopByProjectOidAndChannelTypeAndIsDefault(projectOid, paymentType, Boolean.TRUE);
 
         String payAccountName = orgPayAccountService.buildPayAccountName(projectOid, paymentType);
+
         AccountModel accountModel = new AccountModel();
-        Boolean disable = Boolean.FALSE;
         accountModel.setName(payAccountName);
+
+        Boolean disable = Boolean.FALSE;
         if (ObjectUtils.isNotEmpty(entity)) {
             if (paymentType == PaymentType.WeChat) {
+                // 微信支付
                 accountModel.setProductChannelType(PayProductChannelType.WeChatMiniAppPay);
                 WeChatMiniAppConf appConf = new WeChatMiniAppConf();
                 WxPayConfigModel model = (WxPayConfigModel) entity.getPayConfig();
@@ -451,8 +457,12 @@ public class ProjectPaySettingServiceImpl extends SuperService {
                 appConf.setApiV3KeyPath(model.getApiV3Key());
                 appConf.setNotifyUrl(model.getNotifyUrl());
                 accountModel.setConf(appConf);
+            } else if (paymentType == PaymentType.UnionFrictionlessPay) {
+                // 银联无感支付
+
             }
-            // 支付产品
+
+            // 查看平台支付产品状态
             PayChannelConfig channelConfig = payChannelConfigDao.findTopByPaymentType(paymentType);
             if (ObjectUtils.isNotEmpty(channelConfig)) {
                 if (channelConfig.getState() == null || channelConfig.getState() != DataState.Enable) {