pay/plugins/wxpaynp/inc/config.php
2025-11-28 10:08:12 +08:00

41 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
//微信支付v3配置文件
$wechatpay_config = [
//应用ID
'appid' => $channel['appid'],
//商户号
'mchid' => $channel['appmchid'],
//子商户应用ID可留空
'sub_appid' => isset($channel['sub_appid']) ? $channel['sub_appid'] : '',
//子商户号
'sub_mchid' => $channel['appurl'],
//APIv3密钥
'apikey' => $channel['appsecret'],
//「商户API私钥」文件路径
'merchantPrivateKeyFilePath' => PLUGIN_ROOT.$channel['plugin'].'/cert/apiclient_key.pem',
//「商户API证书」的「证书序列号」
'merchantCertificateSerial' => $channel['appkey'],
//「微信支付平台证书」文件路径
'platformCertificateFilePath' => PLUGIN_ROOT.$channel['plugin'].'/cert/pub_key.pem',
//微信支付平台公钥ID
'platformCertificateSerial' => $channel['publickeyid'],
//是否电商收付通
'ecommerce' => $channel['appswitch'] == '1',
];
if(file_exists(PLUGIN_ROOT.$channel['plugin'].'/cert/'.$channel['appmchid'].'/apiclient_key.pem')){
$wechatpay_config['merchantPrivateKeyFilePath'] = PLUGIN_ROOT.$channel['plugin'].'/cert/'.$channel['appmchid'].'/apiclient_key.pem';
$wechatpay_config['platformCertificateFilePath'] = PLUGIN_ROOT.$channel['plugin'].'/cert/'.$channel['appmchid'].'/pub_key.pem';
}
return $wechatpay_config;