From c16ac90325e1e6437ccd24e7bfc25a276c8c0576 Mon Sep 17 00:00:00 2001 From: liushengpging Date: Thu, 1 Aug 2024 18:14:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?json=E8=A7=A3=E6=9E=90=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=BD=93=EF=BC=8C=E6=96=B9=E6=B3=95=E6=94=B9=E4=B8=BApublic?= =?UTF-8?q?=EF=BC=8C=E6=AD=A4=E6=97=B6=E7=94=A8=E6=88=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=9B=B4=E6=96=B9=E4=BE=BF=E8=87=AA=E5=AE=9A=E4=B9=89CustomHan?= =?UTF-8?q?dler=E7=BB=A7=E6=89=BFNotificationHandler=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=86=99parseBody=E6=96=B9=E6=B3=95=EF=BC=8C=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=B0=83=E7=94=A8CustomHandler#parse=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8D=B3=E5=8F=AF=EF=BC=88=E5=85=8D=E5=8E=BB=E4=BD=BF=E7=94=A8?= =?UTF-8?q?SDK=E8=87=AA=E5=B8=A6json=E7=89=88=E6=9C=AC=E5=8F=8D=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apache/httpclient/notification/NotificationHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java b/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java index 174ef5b..0c4f167 100644 --- a/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java +++ b/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java @@ -78,7 +78,7 @@ private void validate(Request request) throws ValidationException { * @return 解析结果 * @throws ParseException 解析body失败 */ - private Notification parseBody(String body) throws ParseException { + public Notification parseBody(String body) throws ParseException { ObjectReader objectReader = objectMapper.reader(); Notification notification; try { From d8d5258115f22be4608dd7ddcc21cd585b5ce609 Mon Sep 17 00:00:00 2001 From: liushengpging Date: Thu, 1 Aug 2024 18:19:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?json=E8=A7=A3=E6=9E=90=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=BD=93=EF=BC=8C=E6=96=B9=E6=B3=95=E6=94=B9=E4=B8=BApublic?= =?UTF-8?q?=EF=BC=8C=E6=AD=A4=E6=97=B6=E7=94=A8=E6=88=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=9B=B4=E6=96=B9=E4=BE=BF=E8=87=AA=E5=AE=9A=E4=B9=89CustomHan?= =?UTF-8?q?dler=E7=BB=A7=E6=89=BFNotificationHandler=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=86=99parseBody=E6=96=B9=E6=B3=95=EF=BC=8C=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=B0=83=E7=94=A8CustomHandler#parse=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8D=B3=E5=8F=AF=EF=BC=88=E5=85=8D=E5=8E=BB=E4=BD=BF=E7=94=A8?= =?UTF-8?q?SDK=E8=87=AA=E5=B8=A6json=E7=89=88=E6=9C=AC=E5=8F=8D=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apache/httpclient/notification/NotificationHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java b/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java index 0c4f167..34c6cca 100644 --- a/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java +++ b/src/main/java/com/wechat/pay/contrib/apache/httpclient/notification/NotificationHandler.java @@ -97,7 +97,7 @@ public Notification parseBody(String body) throws ParseException { * @param notification 通知结果 * @throws ParseException 参数不合法 */ - private void validateNotification(Notification notification) throws ParseException { + public void validateNotification(Notification notification) throws ParseException { if (notification == null) { throw new ParseException("body解析为空"); } @@ -149,7 +149,7 @@ private void validateNotification(Notification notification) throws ParseExcepti * @param notification 解析body得到的通知结果 * @throws ParseException 解析body失败 */ - private void setDecryptData(Notification notification) throws ParseException { + public void setDecryptData(Notification notification) throws ParseException { Resource resource = notification.getResource(); String getAssociateddData = "";