Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
435 views
in Technique[技术] by (71.8m points)

支付宝 查询 预订单验签返回fasle? 但是回调显示的true?

AlipayTradeQueryResponse response = alipayClient.execute(request);

**HashMap hashMap = Faster.parseJson(response.getBody(), HashMap.class);
? ? ? ? JSONObject bo = (JSONObject)hashMap.get("alipay_trade_query_response");**

**Map<String, String> map = new HashMap<>();
? ? ? ? map.put("sign",hashMap.get("sign").toString());
? ? ? ? bo.entrySet().forEach(t -> {
? ? ? ? ? ? map.put(t.getKey(),t.getValue().toString());
? ? ? ? });
? ? ? ? boolean v1 = AlipaySignature.rsaCheckV1(map, PARAM.get("PUBLIC"), PARAM.get("CHARSET"), PARAM.get("SIGN"));
? ? ? ? System.out.println("验签:"+v1);**

查询和预订单都是false, 但是回调是true

**Map<String, String> map = request.getParameterMap()
? ? ? ? ? ? ? ? .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, t -> t.getValue()[0]));**

boolean v1 = AlipaySignature.rsaCheckV1(map, PARAM.get("PUBLIC"), PARAM.get("CHARSET"), PARAM.get("SIGN"));

System.out.println("验签:"+v1);


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...