//数据包
{"id":"6b46b3e4-1e7c-59d5-84c3-93499c7b708d","create_time":"2022-01-05T15:51:10+08:00","resource_type":"encrypt-resource","event_type":"TRANSACTION.SUCCESS","summary":"支付成功","resource":{"original_type":"transaction","algorithm":"AEAD_AES_256_GCM","ciphertext":"MQN18lzceDWCj8tWzu1XH+ATWpfJQ8SPWs+PQEIyn6Nikk1F9L2kLxTYJ7LP/KMaG1HICkJKLwelVV90VXB16FdGLybUJrXkRQmGCdAutpB5JKiqz9aXPxleeqdMwcGP29y0ABYGwNp/k8pRtZSidtgofQb3zOJXlsMqM2FlTRKug3FsYfq4V780xSygMbzOGm5/mxOHvagCGByuU7mIcJCXiqELjidBPiLFE/KjN4P4VaxI9VGQTZRyUhAcl7dm2WVs060VU6aLF1dXN2WBV0iPtt6JsYRAPYH3aHS12GputZBobHked4yuxNZN6PIKwlmlMc4gd5imh/LrVvbJjfDH4TqmpSo9+wOC/gV/dhzMBBT88sSonSLoKWop5EfdNVDcDA2xbwrYHWHRhljmkLhBgtaLyogFb/ASVsfJRujabKJkPT+3vT5Bn9gfs7gnLDzW8I2HeJTfYCEoBjEkw6H0QW69x5r8xuEk50SJLDN9hNY2hSrxSWxTQaJ5jSgWvOmdMyJpOxRO/z4GhXNE0kmFWKkF+s46Pp+bYu8BR3Dyh85IZ9t46zInVHRbfJ5BmySsBn/fJMFvqTztl4D/mg==","associated_data":"transaction","nonce":"BUxpqQepKKZ9"}}
//apiv3key
1518DB9E0CE59070DA92F7F319DF6A97
php版本7.3.4
解密一直返回false ciphertext base64_decode 也是一直乱码
请问这样的情况 是否是我apiv3key不正确
require_once 'vendor/autoload.php'; use WeChatPay\Crypto\AesGcm; $json = json_decode('{...}'); $res = AesGcm::decrypt($json->resource->ciphertext, $apiv3Key, $json->resource->nonce, $json->resource->associated_data); print_r($res);