TRX 1 年之前
父节点
当前提交
045f3f344a

+ 43 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/cooperator/CooperatorParam.java

@@ -0,0 +1,43 @@
+package com.zhongshu.payment.client.payModel.cooperator;
+
+import com.github.microservice.models.type.PaymentType;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.hibernate.internal.build.AllowPrintStacktrace;
+
+import java.math.BigDecimal;
+
+/**
+ * 提现参数
+ *
+ * @author TRX
+ * @date 2024/9/5
+ */
+@Data
+@AllowPrintStacktrace
+@NoArgsConstructor
+public class CooperatorParam {
+
+    @Schema(description = "支付方式")
+    private PaymentType paymentType;
+
+    @Schema(description = "项目oid")
+    private String projectOid;
+
+    @Schema(description = "用户id")
+    private String userId;
+
+    @Schema(description = "学校oid")
+    private String schoolId;
+
+    @Schema(description = "商户oid")
+    private String shopId;
+
+    @Schema(description = "提现金额,单位分")
+    private BigDecimal withdrawAmt;
+
+    @Schema(description = "提现类型 0 - D0 1 - D1(对公对私是TN内部维护)")
+    private String withdrawType = "0";
+
+}

+ 0 - 12
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/unionFrictionlessPay/model/cooperator/QueryWithdrawBalanceParam.java

@@ -1,12 +0,0 @@
-package com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.cooperator;
-
-import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionSuperParam;
-
-/**
- * 查询商户可提现金额
- *
- * @author TRX
- * @date 2024/8/28
- */
-public class QueryWithdrawBalanceParam extends UnionSuperParam {
-}

+ 91 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/controller/unionFrictionlessPay/CooperatorController.java

@@ -0,0 +1,91 @@
+package com.zhongshu.payment.server.core.controller.unionFrictionlessPay;
+
+import com.github.microservice.auth.security.annotations.ResourceAuth;
+import com.github.microservice.auth.security.helper.AuthHelper;
+import com.github.microservice.auth.security.type.AuthType;
+import com.github.microservice.net.ResultContent;
+import com.zhongshu.payment.client.payModel.commn.PayNotifyParam;
+import com.zhongshu.payment.client.payModel.cooperator.CooperatorParam;
+import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionUserOpenInfoModel;
+import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.SignInParam;
+import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.UserRescissionParam;
+import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.UserSignQueryParam;
+import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.UnionFrictionlessPayMainService;
+import io.swagger.v3.oas.annotations.Hidden;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.servlet.http.HttpServletRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 收钱吧提现
+ *
+ * @author TRX
+ * @date 2024/8/26
+ */
+@Slf4j
+@RestController
+@RequestMapping("/withdraw")
+@Tag(name = "收钱吧提现-业务API")
+public class CooperatorController {
+
+    @Autowired
+    UnionFrictionlessPayMainService unionFrictionlessPayMainService;
+
+    @Autowired
+    AuthHelper authHelper;
+
+    //---------------------------业务 start-----------------------------
+    @Operation(summary = "查询商户可提现金额")
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @PostMapping(value = "queryWithdrawBalance", consumes = MediaType.APPLICATION_JSON_VALUE)
+    public ResultContent queryWithdrawBalance(@RequestBody @Valid CooperatorParam param) {
+        return unionFrictionlessPayMainService.queryWithdrawBalance(param);
+    }
+
+    @Operation(summary = "提现")
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @PostMapping(value = "processWithdraw", consumes = MediaType.APPLICATION_JSON_VALUE)
+    public ResultContent processWithdraw(@RequestBody @Valid CooperatorParam param) {
+        return unionFrictionlessPayMainService.processWithdraw(param);
+    }
+
+    @Operation(summary = "提现状态查询")
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @PostMapping(value = "queryOrderStatus", consumes = MediaType.APPLICATION_JSON_VALUE)
+    public ResultContent queryOrderStatus(@RequestBody @Valid CooperatorParam param) {
+        return unionFrictionlessPayMainService.queryOrderStatus(param);
+    }
+
+    @Operation(summary = "收钱吧-D+0开通权限查询")
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @PostMapping(value = "queryWithdrawAuthstatus", consumes = MediaType.APPLICATION_JSON_VALUE)
+    public ResultContent queryWithdrawAuthstatus(@RequestBody @Valid CooperatorParam param) {
+        return unionFrictionlessPayMainService.queryWithdrawAuthstatus(param);
+    }
+
+    @Operation(summary = "收钱吧-平台方通知开通D+0提现")
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @PostMapping(value = "openWithdraw", consumes = MediaType.APPLICATION_JSON_VALUE)
+    public ResultContent openWithdraw(@RequestBody @Valid CooperatorParam param) {
+        return unionFrictionlessPayMainService.openWithdraw(param);
+    }
+
+    //---------------------------通知 start-----------------------------
+    @Operation(summary = "提现结果通知回调")
+    @PostMapping(value = "withDrawNotify/{sysOrderId}", consumes = MediaType.APPLICATION_JSON_VALUE)
+    @Hidden
+    public void withDrawNotify(
+            HttpServletRequest request,
+            @PathVariable(name = "sysOrderId") String sysOrderId) {
+        log.info("提现通知回调 sysOrderId:{}", sysOrderId);
+        unionFrictionlessPayMainService.withDrawNotify(request, sysOrderId);
+    }
+
+}

+ 172 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/UnionFrictionlessPayMainService.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.github.microservice.app.stream.StreamHelper;
+import com.github.microservice.models.requestModel.SuperCooperatorResponseModel;
 import com.github.microservice.models.requestModel.SuperResponseModel;
 import com.github.microservice.models.type.PaymentType;
 import com.github.microservice.net.ResultContent;
@@ -26,6 +27,8 @@ import com.zhongshu.payment.client.payModel.commn.ClosePayOrderParam;
 import com.zhongshu.payment.client.payModel.commn.CreateOrderParam;
 import com.zhongshu.payment.client.payModel.commn.PayNotifyParam;
 import com.zhongshu.payment.client.payModel.commn.PayOrderParam;
+import com.zhongshu.payment.client.payModel.cooperator.CooperatorParam;
+import com.zhongshu.payment.client.payModel.cooperator.model.*;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.*;
 import com.github.microservice.types.unionFrictionlessPayType.ContractState;
 import com.github.microservice.types.unionFrictionlessPayType.UnionUserOpenType;
@@ -43,6 +46,7 @@ import com.zhongshu.payment.server.core.service.pay.SuperPayService;
 import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayApiConfig;
 import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayConfig;
 import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionPaymentConfig;
+import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.WithdrawConfig;
 import com.zhongshu.payment.server.core.utils.AesUtils;
 import com.zhongshu.payment.server.core.utils.CommonUtil;
 import jakarta.servlet.ServletInputStream;
@@ -105,6 +109,9 @@ public class UnionFrictionlessPayMainService extends SuperPayService {
     @Autowired
     RechargeRecordDao rechargeRecordDao;
 
+    @Autowired
+    WithdrawConfig withdrawConfig;
+
     /**
      * 发起签约
      *
@@ -701,6 +708,171 @@ public class UnionFrictionlessPayMainService extends SuperPayService {
         return ResultContent.buildFail("暂未实现");
     }
 
+    //------------------------提现 start ------------------------
+
+    /**
+     * 查询商户可提现金额
+     *
+     * @param param
+     * @return
+     */
+    public ResultContent queryWithdrawBalance(CooperatorParam param) {
+        QueryWithdrawBalanceParam requestParam = new QueryWithdrawBalanceParam();
+        requestParam.setMchntNo(getMchntNo(param.getShopId()));
+        requestParam.setSysId(withdrawConfig.getSysid());
+        requestParam.setAppType(withdrawConfig.getAppType());
+
+        String url = payApiConfig.getUrl(UnionFrictionlessPayApiConfig.queryWithdrawBalance);
+        SuperCooperatorResponseModel requestAPI = unionRequestService.requestCooperatorAPI
+                (url, requestParam, QueryWithdrawBalanceResponse.class);
+        if (requestAPI.isFailed()) {
+            return ResultContent.buildFail(requestAPI.getMsg());
+        }
+        QueryWithdrawBalanceResponse response = (QueryWithdrawBalanceResponse) requestAPI;
+        return ResultContent.buildSuccess();
+    }
+
+    /**
+     * 提现
+     *
+     * @param param
+     * @return
+     */
+    public ResultContent processWithdraw(CooperatorParam param) {
+        ProcessWithdrawParam requestParam = new ProcessWithdrawParam();
+        requestParam.setMchntNo(getMchntNo(param.getShopId()));
+        requestParam.setSysId(withdrawConfig.getSysid());
+        requestParam.setAppType(withdrawConfig.getAppType());
+        String sysOrderId = collectionIdService.getNextNo();
+        requestParam.setSysOrderId(sysOrderId);
+
+
+        String url = payApiConfig.getUrl(UnionFrictionlessPayApiConfig.processWithdraw);
+        SuperCooperatorResponseModel requestAPI = unionRequestService.requestCooperatorAPI
+                (url, requestParam, ProcessWithdrawResponse.class);
+        if (requestAPI.isFailed()) {
+            return ResultContent.buildFail(requestAPI.getMsg());
+        }
+        ProcessWithdrawResponse response = (ProcessWithdrawResponse) requestAPI;
+        return ResultContent.buildSuccess();
+    }
+
+    /**
+     * 提现状态查询
+     *
+     * @param param
+     * @return
+     */
+    public ResultContent queryOrderStatus(CooperatorParam param) {
+        QueryOrderStatusParam requestParam = new QueryOrderStatusParam();
+
+        String url = payApiConfig.getUrl(UnionFrictionlessPayApiConfig.queryOrderStatus);
+        SuperCooperatorResponseModel requestAPI = unionRequestService.requestCooperatorAPI
+                (url, requestParam, QueryOrderStatusResponse.class);
+        if (requestAPI.isFailed()) {
+            return ResultContent.buildFail(requestAPI.getMsg());
+        }
+        QueryOrderStatusResponse response = (QueryOrderStatusResponse) requestAPI;
+        return ResultContent.buildSuccess();
+    }
+
+    /**
+     * 收钱吧-D+0开通权限查询
+     *
+     * @param param
+     * @return
+     */
+    public ResultContent queryWithdrawAuthstatus(CooperatorParam param) {
+        QueryWithdrawAuthstatusParam requestParam = new QueryWithdrawAuthstatusParam();
+
+        String url = payApiConfig.getUrl(UnionFrictionlessPayApiConfig.queryWithdrawAuthstatus);
+        SuperCooperatorResponseModel requestAPI = unionRequestService.requestCooperatorAPI
+                (url, requestParam, QueryWithdrawAuthstatusResponse.class);
+        if (requestAPI.isFailed()) {
+            return ResultContent.buildFail(requestAPI.getMsg());
+        }
+        QueryWithdrawAuthstatusResponse response = (QueryWithdrawAuthstatusResponse) requestAPI;
+        return ResultContent.buildSuccess();
+    }
+
+    /**
+     * 收钱吧-平台方通知开通D+0提现
+     *
+     * @param param
+     * @return
+     */
+    public ResultContent openWithdraw(CooperatorParam param) {
+        OpenWithdrawParam requestParam = new OpenWithdrawParam();
+        String url = payApiConfig.getUrl(UnionFrictionlessPayApiConfig.openWithdraw);
+        SuperCooperatorResponseModel requestAPI = unionRequestService.requestCooperatorAPI
+                (url, requestParam, OpenWithdrawResponse.class);
+        if (requestAPI.isFailed()) {
+            return ResultContent.buildFail(requestAPI.getMsg());
+        }
+        OpenWithdrawResponse response = (OpenWithdrawResponse) requestAPI;
+
+        return ResultContent.buildSuccess();
+    }
+
+    /**
+     * 得到商户的  银联 商户号
+     *
+     * @param shopOid
+     * @return
+     */
+    public String getMchntNo(String shopOid) {
+        return "898460107800191";
+    }
+
+    /**
+     * 提现结果回调
+     *
+     * @param request
+     * @param sysOrderId
+     * @return
+     */
+    @SneakyThrows
+    public ResultContent withDrawNotify(HttpServletRequest request, String sysOrderId) {
+        ServletInputStream inputStream = request.getInputStream();
+        StringBuffer stringBuffer = new StringBuffer();
+        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+        String s;
+        //读取回调请求体
+        while ((s = bufferedReader.readLine()) != null) {
+            stringBuffer.append(s);
+        }
+        String body = stringBuffer.toString();
+        log.info("body: {}", body);
+//        PayNotifyResponse notifyResponse = jsonHelper.toObject(body, PayNotifyResponse.class);
+
+
+        Map<String, String> header = new HashMap<>();
+        log.info("stringBuffer: {}", stringBuffer.toString());
+        Enumeration<String> exception = request.getHeaderNames();
+        while (exception.hasMoreElements()) {
+            String key = exception.nextElement();
+            String value = request.getHeader(key);
+            log.info("key: {}, value: {}", key, value);
+            header.put(key, value);
+        }
+
+        String authorization = request.getHeader("X-Authorization");
+        log.info("authorization: {}", authorization);
+        Map<String, String[]> map = request.getParameterMap();
+        Map<String, String> paramMap = new LinkedHashMap<>();
+        map.forEach((String key, String[] values) -> {
+            log.info("key: {}, values: {}", key, values);
+            paramMap.put(key, values[0]);
+        });
+        JSONObject jsonObject = new JSONObject(paramMap);
+        QueryOrderStatusResponse orderStatusResponse = JSONUtil.toBean(jsonObject, QueryOrderStatusResponse.class);
+
+        return ResultContent.buildSuccess();
+    }
+
+    //------------------------提现 end-- ------------------------
+
+
     /**
      * 查询签约的信息
      *

+ 102 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/UnionRequestService.java

@@ -10,6 +10,7 @@ import com.github.microservice.core.util.net.apache.HttpClientUtil;
 import com.github.microservice.core.util.net.apache.HttpModel;
 import com.github.microservice.core.util.net.apache.MethodType;
 import com.github.microservice.core.util.net.apache.ResponseModel;
+import com.github.microservice.models.requestModel.SuperCooperatorResponseModel;
 import com.github.microservice.models.requestModel.SuperResponseModel;
 import com.zhongshu.card.client.model.payment.RequestInfoSaveParam;
 import com.zhongshu.card.client.service.feign.RequestInfoFeignService;
@@ -20,6 +21,7 @@ import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionSupe
 import com.zhongshu.payment.server.core.service.base.SuperService;
 import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayConfig;
 import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionPaymentConfig;
+import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.WithdrawConfig;
 import com.zhongshu.payment.server.core.utils.AesUtils;
 import com.zhongshu.payment.server.core.utils.CommonUtil;
 import lombok.SneakyThrows;
@@ -59,6 +61,9 @@ public class UnionRequestService extends SuperService {
     @Autowired
     UnionFrictionlessPayConfig payConfig;
 
+    @Autowired
+    WithdrawConfig withdrawConfig;
+
     /**
      * 银联请求
      *
@@ -161,6 +166,103 @@ public class UnionRequestService extends SuperService {
         return responseModel;
     }
 
+    /**
+     * 悦融益业务对接开放平台
+     *
+     * @param url
+     * @param data
+     * @param tClass
+     * @return
+     */
+    public SuperCooperatorResponseModel requestCooperatorAPI(String url,
+            Object data,
+            Class<? extends SuperCooperatorResponseModel> tClass) {
+        RequestInfoSaveParam param = new RequestInfoSaveParam();
+        param.setParam(data);
+        param.setApiParam(url);
+        param.setUserId(getCurrentUserId());
+        SuperCooperatorResponseModel responseModel = null;
+        try {
+            responseModel = tClass.newInstance();
+            ApiConfParam apiConfParam = new ApiConfParam();
+            apiConfParam.setApiName(url);
+            apiConfParam.setMethodType(MethodType.Json);
+            String dataJsonStr = JSONUtil.toJsonStr(data);
+            String sign = AesUtils.signData(dataJsonStr);
+            // 请求时间记时
+            StopWatch stopWatch = new StopWatch();
+            stopWatch.start();
+
+            String timestamp = DateUtils.paresTime(System.currentTimeMillis(), DateUtils.unionAuth);
+            String nonce = CommonUtil.UUID();
+            String c = String.format("%s%s%s%s", payConfig.getAppId(), timestamp, nonce, sign);
+
+            String signature = AesUtils.signMacSHA256(c, payConfig.getAppKey());
+            String authorization = "OPEN-BODY-SIG AppId=" + "\"" + payConfig.getAppId() + "\""
+                    + ",Timestamp=" + "\"" + timestamp + "\""
+                    + ",Nonce=" + "\"" + nonce + "\""
+                    + ",Signature=" + "\"" + signature + "\"";
+            String response = "";
+            PrintWriter out = null;
+            BufferedReader in = null;
+            int code = 400;
+            try {
+                URL realUrl = new URL(url);
+                URLConnection conn = realUrl.openConnection();
+                HttpURLConnection httpUrlConnection = (HttpURLConnection) conn;
+                httpUrlConnection.setRequestProperty("Content-Type", "application/json");
+                httpUrlConnection.setRequestProperty("authorization", authorization);
+                httpUrlConnection.setDoOutput(true);
+                httpUrlConnection.setDoInput(true);
+                out = new PrintWriter(httpUrlConnection.getOutputStream());
+                out.write(dataJsonStr);
+                out.flush();
+                httpUrlConnection.connect();
+                code = httpUrlConnection.getResponseCode();
+                in = new BufferedReader(new InputStreamReader(httpUrlConnection.getInputStream()));
+                String line;
+                while ((line = in.readLine()) != null) {
+                    response += line;
+                }
+                log.info("response: {}", response);
+                responseModel = jsonHelper.toObject(response, tClass);
+            } catch (Exception e) {
+                e.printStackTrace();
+                responseModel.setCode(code);
+                responseModel.setMsg(e.getMessage());
+            } finally {
+                try {
+                    if (out != null) {
+                        out.close();
+                    }
+                    if (in != null) {
+                        in.close();
+                    }
+                } catch (Exception ex) {
+                    ex.printStackTrace();
+                }
+            }
+            log.info("response: {} {}", responseModel.getRespCode(), code);
+            responseModel.setCode(code);
+            if (code == 504) {
+                responseModel.setRespDesc("银联服务无法访问");
+            }
+            stopWatch.stop();
+            responseModel.setMillis(stopWatch.getTotalTimeMillis());
+        } catch (Exception e) {
+            e.printStackTrace();
+            responseModel.setFailed(String.format("请求出错:%s", e.getMessage()));
+            return responseModel;
+        }
+        param.setMillis(responseModel.getMillis());
+        param.setIsSuccess(responseModel.isSuccess);
+        param.setMsg(responseModel.getMsg());
+        param.setResponse(responseModel);
+        param.setRequestType(RequestType.UnionFrictionlessPay);
+        // 请求日志
+        requestInfoFeignService.saveRequestInfo(param);
+        return responseModel;
+    }
 
     /**
      * 通用请求

+ 0 - 13
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/UnionBalanceConfig.java

@@ -9,17 +9,4 @@ package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.c
 public class UnionBalanceConfig {
 
 
-    public static final String appId = "10037e6f72da8f490172fa3cb8e80003";
-
-
-    public static final String appKey = "34ba53033a5242158b0e7144aa34a215";
-
-    // 系统编号
-    public static final String sysid = "FZ001_YRY";
-
-    // 商户号
-    public static final String mchntNo = "898460107800191";
-
-    // 多应用类型
-    public static final String appType = "74";
 }

+ 59 - 15
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/UnionFrictionlessPayApiConfig.java

@@ -23,49 +23,66 @@ public class UnionFrictionlessPayApiConfig {
     public UnionFrictionlessPayConfig payConfig;
 
     // 申请扣款
-    public static String pay = "pay";
+    public static final String pay = "pay";
 
     // 支付并签约
-    public static String payOpen = "payOpen";
+    public static final String payOpen = "payOpen";
 
     // 申请退款
-    public static String refund = "refund";
+    public static final String refund = "refund";
 
     // 退款查询
-    public static String refundQuery = "refundQuery";
+    public static final String refundQuery = "refundQuery";
 
     // 交易查询
-    public static String payQuery = "payQuery";
+    public static final String payQuery = "payQuery";
 
     // 商户签约
-    public static String sign = "sign";
+    public static final String sign = "sign";
 
     // 商户解约
-    public static String rescission = "rescission";
+    public static final String rescission = "rescission";
 
     // 签约状态查询
-    public static String signQuery = "signQuery";
+    public static final String signQuery = "signQuery";
 
     // 申请扣款
-    public static String senselessPay = "senselessPay";
+    public static final String senselessPay = "senselessPay";
 
     // 交易查询
-    public static String netPayQuery = "netPayQuery";
+    public static final String netPayQuery = "netPayQuery";
 
     // 支付并签约
-    public static String senselessPayAndOpen = "senselessPayAndOpen";
+    public static final String senselessPayAndOpen = "senselessPayAndOpen";
 
     // 云闪付申请退款
-    public static String uacRefund = "uacRefund";
+    public static final String uacRefund = "uacRefund";
 
     // 云闪付申请退款 状态查询
-    public static String uacRefundQuery = "refundQuery";
+    public static final String uacRefundQuery = "refundQuery";
 
     // 云闪付 订单查询
-    public static String orderQuery = "orderQuery";
+    public static final String orderQuery = "orderQuery";
 
     // 查询卡列表
-    public static String cardListQuery = "card-list-query";
+    public static final String cardListQuery = "card-list-query";
+
+    // 悦融益业务对接开放平台-合作商户 接口start ---------------------
+
+    // 查询商户可提现金额
+    public static final String queryWithdrawBalance = "query-withdraw-balance";
+
+    // 提现
+    public static final String processWithdraw = "process-withdraw";
+
+    // 提现状态查询
+    public static final String queryOrderStatus = "query-order-status";
+
+    // 收钱吧-D+0开通权限查询
+    public static final String queryWithdrawAuthstatus = "query-withdraw-authstatus";
+
+    // 收钱吧-平台方通知开通D+0提现
+    public static final String openWithdraw = "open-withdraw";
 
     private static List<UnionPayApi> apis = new ArrayList<>();
 
@@ -156,6 +173,33 @@ public class UnionFrictionlessPayApiConfig {
                 .prodUrl("https://api-mop.chinaums.com/v1/inip/sign/uac/card-list-query")
                 .build());
 
+        // 悦融益业务对接开放平台-合作商户 接口start ---------------------
+
+        apis.add(UnionPayApi.builder().apiKey(queryWithdrawBalance)
+                .devUrl("https://test-api-open.chinaums.com/v1/tn/cooperator/query-withdraw-balance")
+                .prodUrl("https://api-mop.chinaums.com/v1/tn/cooperator/query-withdraw-balance")
+                .build());
+
+        apis.add(UnionPayApi.builder().apiKey(processWithdraw)
+                .devUrl("https://test-api-open.chinaums.com/v1/tn/cooperator/process-withdraw")
+                .prodUrl("https://api-mop.chinaums.com/v1/tn/cooperator/process-withdraw")
+                .build());
+
+        apis.add(UnionPayApi.builder().apiKey(queryOrderStatus)
+                .devUrl("https://test-api-open.chinaums.com/v1/tn/cooperator/query-order-status")
+                .prodUrl("https://api-mop.chinaums.com/v1/tn/cooperator/query-order-status")
+                .build());
+
+        apis.add(UnionPayApi.builder().apiKey(queryWithdrawAuthstatus)
+                .devUrl("https://test-api-open.chinaums.com/v1/tn/cooperator/query-withdraw-authstatus")
+                .prodUrl("https://api-mop.chinaums.com/v1/tn/cooperator/query-withdraw-authstatus")
+                .build());
+
+        apis.add(UnionPayApi.builder().apiKey(openWithdraw)
+                .devUrl("https://test-api-open.chinaums.com/v1/tn/cooperator/open-withdraw")
+                .prodUrl("https://api-mop.chinaums.com/v1/tn/cooperator/open-withdraw")
+                .build());
+
     }
 
     public String getUrl(String key) {

+ 29 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/WithdrawConfig.java

@@ -0,0 +1,29 @@
+package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
+
+/**
+ * 提现的配置
+ *
+ * @author TRX
+ * @date 2024/9/5
+ */
+@Data
+@Component
+@Configuration
+@ConfigurationProperties(prefix = "withdraw")
+public class WithdrawConfig {
+
+    public String appId = "";
+
+    public String appKey = "";
+
+    // 系统编号
+    public String sysid = "";
+
+    // 多应用类型
+    public String appType = "74";
+}