From 58c3afee08a5d0632a8dd010c11fca29a89b5afa Mon Sep 17 00:00:00 2001 From: zwy Date: Wed, 27 Apr 2022 10:10:39 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E3=80=90=E6=94=AF=E4=BB=98=E5=AE=9D?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=9B=9E=E8=B0=83=E3=80=91=EF=BC=9A=20Abstra?= =?UTF-8?q?ctAlipayClient.java=20=EF=BC=9A=20=E6=94=AF=E4=BB=98=E5=AE=9D?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=9B=9E=E8=B0=83=E5=8F=82=E6=95=B0=20=20str?= =?UTF-8?q?=E8=BD=ACmap=20=E9=80=9A=E7=9F=A5=E5=9B=9E=E8=B0=83=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20Map=20params=20=3D=20notifyData.g?= =?UTF-8?q?etParams();=20Map=20params=20=3D=20strToMap(n?= =?UTF-8?q?otifyData.getBody());?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/alipay/AbstractAlipayClient.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java index 7cb24145a..955b1fc4e 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java @@ -18,6 +18,7 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import java.nio.charset.StandardCharsets; +import java.util.HashMap; import java.util.Map; import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; @@ -54,7 +55,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient params = data.getParams(); + Map params = strToMap(data.getBody()); return PayOrderNotifyRespDTO.builder().orderExtensionNo(params.get("out_trade_no")) .channelOrderNo(params.get("trade_no")).channelUserId(params.get("seller_id")) .tradeStatus(params.get("trade_status")) @@ -64,7 +65,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient params = notifyData.getParams(); + Map params = strToMap(notifyData.getBody()); PayRefundNotifyDTO notifyDTO = PayRefundNotifyDTO.builder().channelOrderNo(params.get("trade_no")) .tradeNo(params.get("out_trade_no")) .reqNo(params.get("out_biz_no")) @@ -128,4 +129,25 @@ public abstract class AbstractAlipayClient extends AbstractPayClient strToMap(String s) { + Map stringStringMap = new HashMap<>(); + //调整时间格式 + String s3 = s.replaceAll("%3A", ":"); + //获取map + String s4 = s3.replace("+", " "); + String[] split = s4.split("&"); + for (String s1 : split) { + String[] split1 = s1.split("="); + stringStringMap.put(split1[0], split1[1]); + } + return stringStringMap; + } + }