From eb6b6dbb35a9f029e0b7d269773685c19fd40976 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 11 七月 2024 10:47:51 +0800
Subject: [PATCH] 玩湃微信商户认证代码

---
 cloud-server-other/src/main/java/com/dsh/other/util/PayMoneyUtil.java |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/cloud-server-other/src/main/java/com/dsh/other/util/PayMoneyUtil.java b/cloud-server-other/src/main/java/com/dsh/other/util/PayMoneyUtil.java
index b5519f5..9974105 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/util/PayMoneyUtil.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/util/PayMoneyUtil.java
@@ -114,6 +114,47 @@
             return ResultUtil.error("出现问题啦");
         }
     }
+    // 属于平台的运营商 因为无需分账不冻结资金
+    public ResultUtil confirm1(String smid,String code, String outTradeNo, String amount) {
+        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
+                aliAppid,
+                appPrivateKey,
+                "json",
+                "GBK",
+                alipay_public_key,
+                "RSA2");
+        AlipayTradeSettleConfirmRequest request = new AlipayTradeSettleConfirmRequest();
+        request.setBizContent("{" +
+                "  \"out_request_no\":\""+code+"\"," +
+                "  \"trade_no\":\""+outTradeNo+"\"," +
+                "  \"settle_info\":{" +
+                "    \"settle_detail_infos\":[" +
+                "      {" +
+                "        \"trans_in_type\":\"defaultSettle\"," +
+                "        \"settle_entity_id\":\""+smid+"\"," +
+                "        \"settle_entity_type\":\"SecondMerchant\"," +
+                "        \"amount\":"+amount+"," +
+                "      }" +
+                "    ]" +
+                "  }," +
+                "  \"extend_params\":{" +
+                "    \"royalty_freeze\":\"false\"" +
+                "  }" +
+                "}");
+        AlipayTradeSettleConfirmResponse response = null;
+        try {
+            response = alipayClient.execute(request);
+        } catch (AlipayApiException e) {
+            e.printStackTrace();
+        }
+        if(response.isSuccess()){
+            System.out.println("调用成功");
+            return ResultUtil.success();
+        } else {
+            System.out.println("调用失败");
+            return ResultUtil.error("出现问题啦");
+        }
+    }
     /**
      * 支付宝支付
      */

--
Gitblit v1.7.1