提交代码

yy_dev
胡锐 1 year ago
parent 5ff14ba617
commit 728e48c566
  1. 2
      open-api/src/main/java/com/api/controller/v1/NotifyController.java
  2. 5
      service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java

@ -76,7 +76,7 @@ public class NotifyController {
body.getString("trade_no"), body.getString("trade_no"),
PlatformTypeEnum.type1, PlatformTypeEnum.type1,
TradeOrderPayModeEnum.getNameByCode(body.getString("account_type")), 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"), body.getString("merchant_no"),
other other
); );

@ -83,12 +83,13 @@ public class SignatureUtil {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String paramStr = "{\n" + String paramStr = "{\n" +
" \"merchantNo\": \"2023041916292112804\",\n" + " \"merchantNo\": \"2023041916292112804\",\n" +
" \"outTradeNo\": \"ZF1130202305051459532538970005\",\n" + " \"outTradeNo\": \"ZF1130202305051459532538970006\",\n" +
" \"payMode\": \"WECHAT\",\n" + " \"payMode\": \"WECHAT\",\n" +
" \"totalAmount\": 0.01,\n" + " \"totalAmount\": 0.01,\n" +
" \"transType\": \"JSAPI\",\n" + " \"transType\": \"JSAPI\",\n" +
" \"userId\": \"od8qG06bHnTsDWklsB2VsssLZYcQ\",\n" + " \"userId\": \"od8qG06bHnTsDWklsB2VsssLZYcQ\",\n" +
" \"profitSharing\": 0" + " \"profitSharing\": 0,\n" +
" \"specialField\": \"测试\"" +
"}"; "}";
String sign = createSign(JSONObject.parseObject(paramStr), "2jLO2WjXcSRSzTCaca0Kmv0OFrfYBbrA"); String sign = createSign(JSONObject.parseObject(paramStr), "2jLO2WjXcSRSzTCaca0Kmv0OFrfYBbrA");
System.out.println(sign); System.out.println(sign);

Loading…
Cancel
Save