From db287aac9eb5032b1158b405a9b4807301467ed3 Mon Sep 17 00:00:00 2001 From: zhouxiang <zhouxiang> Date: 星期四, 24 三月 2022 17:48:03 +0800 Subject: [PATCH] 添加redis获取整个hashKey数据和单个hashKey数据方法 --- src/main/java/com/hx/corp/util/WxCorpPayUtil.java | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hx/corp/util/WxCorpPayUtil.java b/src/main/java/com/hx/corp/util/WxCorpPayUtil.java index 9f29441..a4aa6fc 100644 --- a/src/main/java/com/hx/corp/util/WxCorpPayUtil.java +++ b/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) { -- Gitblit v1.8.0