wechatpay-php报错,提示"Type is not supported"?
// 商户号,假定为`1000100`
$merchantId = 1535395261;//$weixin['mchid'];//'1000100';
// 商户私钥,文件路径假定为 `/path/to/merchant/apiclient_key.pem`
$merchantPrivateKeyFilePath = CMF_ROOT.'data/config/apiclient_key.pem';
// 加载商户私钥
$merchantPrivateKeyInstance = PemUtil::loadPrivateKey($merchantPrivateKeyFilePath);
$merchantCertificateSerial = '61B86069DDC8DC5F68D011B8074430BA0AEEA16F';//$weixin['cretno']'';// API证书不重置,商户证书序列号就是个常量
// // 也可以使用openssl命令行获取证书序列号
//openssl x509 -in /path/to/merchant/apiclient_cert.pem -noout -serial | awk -F= '{print $2}'
// // 或者从以下代码也可以直接加载
// // 商户证书,文件路径假定为 `/path/to/merchant/apiclient_cert.pem`
//$merchantCertificateFilePath = CMF_ROOT.'data/config/weixin_cert.pem';
// // 加载商户证书
//$merchantCertificateInstance = PemUtil::loadCertificate($merchantCertificateFilePath);
// // 解析商户证书序列号
//$merchantCertificateSerial = PemUtil::parseCertificateSerialNo($merchantCertificateInstance);
//echo $merchantCertificateSerial;print_r($pay);die;
// 平台证书,可由下载器 `./bin/CertificateDownloader.php` 生成并假定保存为 `/path/to/wechatpay/cert.pem`
$platformCertificateFilePath = CMF_ROOT.'data/config/apiclient_cert.pem';
// 加载平台证书
$platformCertificateInstance = PemUtil::loadCertificate($platformCertificateFilePath);
// 解析平台证书序列号
$platformCertificateSerial = PemUtil::parseCertificateSerialNo($platformCertificateInstance);
$config = [
'mchid' => $merchantId,
'serial' => $merchantCertificateSerial,
'privateKey' => $merchantPrivateKeyInstance,
'certs' => [
$platformCertificateSerial => $platformCertificateInstance,
],
];
$instance = Builder::factory($config);
z这个逻辑包"Type is not supported",不知道哪里出问题了。
{"code":0,"message":"Type is not supported","traces":[{"name":"InvalidArgumentException","file":"\/mnt\/www\/wwwroot\/cloud.boiots.cn\/vendor\/topthink\/framework\/src\/think\/response\/Json.php",