无关风月
2025-04-28 e7e7a3a2e5cd9aefa3e71dd05bbc5f6f4b88a1c0
cloud-server-activity/src/main/java/com/dsh/activity/util/PayMoneyUtil.java
@@ -61,8 +61,9 @@
    private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号
//    private String callbackPath = "https://online.daowepark.com:443/activity";//支付回调网关地址
    private String callbackPath = "http://vbef9arg13uu.guyubao.com/activity";//支付回调网关地址
    private String callbackPath = "https://online.daowepark.com:443/activity";//支付回调网关地址
//    private String callbackPath = "http://vbef9arg13uu.guyubao.com/activity";//支付回调网关地址
    private String app_cert_path = "C:/cert/alipay/user/app_cert_path.crt";//应用公钥证书路径
@@ -71,6 +72,7 @@
    private String alipay_root_cert_path = "C:/cert/alipay/user/alipay_root_cert_path.crt";//支付宝CA根证书文件路径
    private String certPath = "/usr/playpai/cert/weixin/apiclient_cert.p12";//微信证书
//    private String certPath = "D:/apiclient_cert.p12";//微信证书
    public ResultUtil confirm(String smid,String code, String outTradeNo, String amount) {
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
@@ -156,6 +158,9 @@
    /**
     * 支付宝支付
     */
    /**
     * 支付宝支付
     */
    public ResultUtil alipay(String smid,String body, String subject, String passbackParams, String outTradeNo, String amount, String notifyUrl) {
//        //构造client
//        CertAlipayRequest certAlipayRequest = new CertAlipayRequest ();
@@ -207,6 +212,8 @@
//        }  catch (AlipayApiException e ) {
//            e.printStackTrace();
//        }
        //实例化客户端
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipay_public_key, "RSA2");
        //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
@@ -237,6 +244,7 @@
        model.setExtendParams(extendParams);
        request.setBizModel(model);
        request.setNotifyUrl(callbackPath + notifyUrl);
        try {
            //这里和普通的接口调用不同,使用的是sdkExecute
            AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
@@ -400,6 +408,7 @@
        Map<String, Object> map = new HashMap<>();
        map.put("appid", appid);
        map.put("mch_id", mchId);
        map.put("sub_mch_id", "123456");
        map.put("nonce_str", nonce_str);
        String temp = "";
        if (body.split("-").length>1){