好好看支付文档,第二次签名的字段和类型
微信小程序支付v3接口生成二次签名paysign,一直提示支付验证失败?public static String getTokenTwo (String appId, String packag) throws IOException, SignatureException, NoSuchAlgorithmException, InvalidKeyException { String nonceStr = getRandomString(32); long timestamp = System.currentTimeMillis() / 1000; String message = buildMessageTwo( appId,timestamp,nonceStr,packag); String signature = sign(message.getBytes("utf-8")); return signature; } private static String buildMessageTwo(String appId, long timestamp, String nonceStr, String packag) { return appId + "\n" + timestamp + "\n" + nonceStr + "\n" + packag + "\n"; } private static String sign(byte[] message) throws NoSuchAlgorithmException, SignatureException, IOException, InvalidKeyException { Signature sign = Signature.getInstance("SHA256withRSA"); //SHA256withRSA PrivateKey privateKey = getPrivateKey("密钥文件地址"); sign.initSign(privateKey); sign.update(message); return Base64.getEncoder().encodeToString(sign.sign()); }
2020-12-28prepayId 是不是错了?
微信支付调起微信失败?appid wx8ffebceb8a88e14f WXPayCallBackActivity onResp====={"prepayId":"wx28124532229645ce8da65e3887df710000","errCode":-1} 只返回错误码,无法调起微信支付,这是什么问题?不知道哪里出问题啊
2020-12-28