From 728e48c566eccaf1165cdc18c9027f1466db5ab8 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 12 Jul 2023 10:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/api/controller/v1/NotifyController.java | 2 +- .../main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/open-api/src/main/java/com/api/controller/v1/NotifyController.java b/open-api/src/main/java/com/api/controller/v1/NotifyController.java index 175ae57..241117a 100644 --- a/open-api/src/main/java/com/api/controller/v1/NotifyController.java +++ b/open-api/src/main/java/com/api/controller/v1/NotifyController.java @@ -76,7 +76,7 @@ public class NotifyController { body.getString("trade_no"), PlatformTypeEnum.type1, TradeOrderPayModeEnum.getNameByCode(body.getString("account_type")), - body.getBigDecimal("payer_amount").divide(new BigDecimal("100")), + body.getBigDecimal("total_amount").divide(new BigDecimal("100")), body.getString("merchant_no"), other ); diff --git a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java index 5db7df2..1857f33 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java +++ b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java @@ -83,12 +83,13 @@ public class SignatureUtil { public static void main(String[] args) throws Exception { String paramStr = "{\n" + " \"merchantNo\": \"2023041916292112804\",\n" + - " \"outTradeNo\": \"ZF1130202305051459532538970005\",\n" + + " \"outTradeNo\": \"ZF1130202305051459532538970006\",\n" + " \"payMode\": \"WECHAT\",\n" + " \"totalAmount\": 0.01,\n" + " \"transType\": \"JSAPI\",\n" + " \"userId\": \"od8qG06bHnTsDWklsB2VsssLZYcQ\",\n" + - " \"profitSharing\": 0" + + " \"profitSharing\": 0,\n" + + " \"specialField\": \"测试\"" + "}"; String sign = createSign(JSONObject.parseObject(paramStr), "2jLO2WjXcSRSzTCaca0Kmv0OFrfYBbrA"); System.out.println(sign);