[图片][图片]
小程序打开h5页面后,在浏览器中打开,但是没有在浏览器中打开的选项,复制连接也不是正常的url?小程序打开h5页面后,在浏览器中打开,但是没有在浏览器中打开的选项,复制连接也不是正常的url,无法访问
2022-08-12//支付数据加密模拟 public static String payNotify() throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { //密文数据 String test = DataDemo.V3_PAY_NOTIFY_JSON; //随机串 String nonce = "xxxxxx"; //附加数据 String fj = ""; Cipher cipher = Cipher.getInstance(WxV3Constant.AES_GCM); byte[] aesKey = WxV3Constant.KEY_V3.getBytes(); SecretKeySpec key = new SecretKeySpec(aesKey, "AES"); GCMParameterSpec spec = new GCMParameterSpec(128, nonce.getBytes(StandardCharsets.UTF_8)); cipher.init(Cipher.ENCRYPT_MODE, key, spec); cipher.updateAAD(fj.getBytes(StandardCharsets.UTF_8)); byte[] encrypted = cipher.doFinal(test.getBytes()); return Base64Util.encode(encrypted); } //退款数据加密模拟 public static String refundNotify() throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { //密文数据 String test = DataDemo.V3_REFUND_JSON; //随机串 String nonce = "xxxxx"; //附加数据 String fj = ""; Cipher cipher = Cipher.getInstance(WxV3Constant.AES_GCM); byte[] aesKey = WxV3Constant.KEY_V3.getBytes(); SecretKeySpec key = new SecretKeySpec(aesKey, "AES"); GCMParameterSpec spec = new GCMParameterSpec(128, nonce.getBytes(StandardCharsets.UTF_8)); cipher.init(Cipher.ENCRYPT_MODE, key, spec); cipher.updateAAD(fj.getBytes(StandardCharsets.UTF_8)); byte[] encrypted = cipher.doFinal(test.getBytes()); return Base64Util.encode(encrypted); } public static void main(String[] args) throws NoSuchPaddingException, InvalidKeyException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException { String s = payNotify(); System.out.println(s); String s1 = refundNotify(); System.out.println(s1); }
V3支付、退款回调的数据微信那边是如何加密的?"original_type": "transaction","algorithm": "AEAD_AES_256_GCM", "ciphertext": "", "associated_data": "", "nonce": "" resource里面将数据加密后回传给商户开发者,然后商户端的开发者解析数据进行业务处理,问题是你们如何加密的,我无法模拟数据的加密,官方只提供了解密的案例,没有加密的案例。无法在线上调试。
2021-12-23解决了没?我也遇到这个问题
v3api-微信支付sdk 报【加密原串的长度不能超过214字节】v3api-微信支付sdk 报【加密原串的长度不能超过214字节】 [图片]
2021-12-23