浏览器直接访问 访问test1 方法 输出的内容 ctrl + U 查看源代码 或者右键 查看源代码 复制保存到文件就可以了!!!
const AUTH_TAG_LENGTH_BYTE = 16;
public function test1(){
$wx_config = [
// 前面的appid什么的也得保留哦
'app_id' => '', // appid
'mch_id' => '', // 商户号
'key' => '', // apiV3 秘钥
'cert_path' => ROOT_PATH.'cert3/apiclient_cert.pem', // 绝对路径!!!!
'key_path' => ROOT_PATH.'cert3/apiclient_key.pem', // 绝对路径!!!!
];
//获取证书
$url2 = '/v3/certificates';
$token2 = self::token1($url2,'GET','',$wx_config);
$url3 = 'https://api.mch.weixin.qq.com/v3/certificates';
$serial1 = self::https_request($url3,'',$token2);
$arr = json_decode($serial1,true);
$serial = $arr['data'][0]['serial_no'];
// 这里是获取 平台证书的地方 解密之后 需要自行保存
$associated_data = $arr['data'][0]['encrypt_certificate']['associated_data'];
$ciphertext = $arr['data'][0][