chenjiahe
2022-02-09 3477046445264ab06bb66972aca69566caa11ae1
src/main/java/com/hx/corp/util/WxCorpPayUtil.java
@@ -71,20 +71,21 @@
        parameters.put("nonce_str", corpPayRequest.getNonce_str());
        parameters.put("openid", corpPayRequest.getOpenid());
        parameters.put("check_name", corpPayRequest.getCheck_name());
        parameters.put("amount", corpPayRequest.getAmount());
        parameters.put("amount", corpPayRequest.getAmount().toString());
        parameters.put("spbill_create_ip", corpPayRequest.getSpbill_create_ip());
        parameters.put("desc", corpPayRequest.getDesc());
        String sign = WXSignUtils.createSign("UTF-8", parameters, mchKey);
        parameters.put("sign", sign);
        corpPayRequest.setSign(WXSignUtils.createSign("UTF-8", parameters, mchKey));
        parameters.put("sign", corpPayRequest.getSign());
        String xmlInfo = HttpXmlUtils.transferXml(parameters);
        try {
            CloseableHttpResponse response = HttpUtil.Post(CORP_PAY_URL, xmlInfo, true, certPath, corpPayRequest.getMchid());
            String transfersXml = EntityUtils.toString(response.getEntity(), "utf-8");
            // System.out.println("渠道端企业付款:" + transfersXml);
            Map<String, String> transferMap = HttpXmlUtils.parseRefundXml(transfersXml);
           //Map<String, String> transferMap = HttpXmlUtils.parseRefundXml(transfersXml);
            Map<String,Object> transferMap = XMLUtil.doXMLParse(transfersXml);
            // 将 Map 转换为 实体类
            corpPayResponse = JSON.parseObject(JSON.toJSONString(transferMap),CorpPayResponse.class);
        } catch (Exception e) {