easywechat4.x升级到6.x
This commit is contained in:
@@ -9,18 +9,22 @@ return [
|
||||
'domain' => 'https://' . Env::get('oss.BUCKET') . '.oss-cn-shenzhen.aliyuncs.com/',
|
||||
],
|
||||
'wechat' => [
|
||||
'app_id' => Env::get('wechat.app_id'),
|
||||
'secret' => Env::get('wechat.app_secret'),
|
||||
'mch_id' => Env::get('wechat.mch_id') ,
|
||||
'key' => Env::get('wechat.api_key'), // API 密钥
|
||||
// 如需使用敏感接口(如退款、发送红包等)需要配置 API 证书路径(登录商户平台下载 API 证书)
|
||||
'cert_path' => APP_PATH. '/extra/cert/apiclient_cert.pem', // XXX: 绝对路径!!!!
|
||||
'key_path' => APP_PATH . '/extra/cert/apiclient_key.pem', // XXX: 绝对路径!!!!
|
||||
'notify_url' => Env::get('app.url') . '/api/order/payNotify', // 你也可以在下单时单独设置来想覆盖它
|
||||
'response_type' => 'array',
|
||||
'log' => [
|
||||
'level' => 'debug',
|
||||
'file' => LOG_PATH . '/wechat.log',
|
||||
],
|
||||
// 小程序
|
||||
'app_id' => Env::get('wechat.app_id'),
|
||||
'secret' => Env::get('wechat.app_secret'),
|
||||
// 微信支付 v3 (EasyWeChat 6.x)
|
||||
'mch_id' => Env::get('wechat.mch_id'), // 商户号
|
||||
'secret_key' => Env::get('wechat.mch_secret_key'), // APIv3 密钥(商户平台-账户中心-API安全)
|
||||
'v2_secret_key' => Env::get('wechat.api_key'), // 旧 v2 API 密钥(兼容 v2 模式回调解密)
|
||||
// 商户 API 证书(商户平台-账户中心-API安全 下载, v2/v3 共用同一套)
|
||||
'private_key' => APP_PATH . 'extra/cert/apiclient_key.pem', // 商户证书私钥 绝对路径
|
||||
'certificate' => APP_PATH . 'extra/cert/apiclient_cert.pem', // 商户API证书 绝对路径
|
||||
// 微信支付公钥模式(2024Q3+ 推荐): 公钥ID以 PUB_KEY_ID_ 开头, 公钥文件存放于 extra/cert/wechatpay_pub.pem
|
||||
// 两者都配置后无需再下载平台证书
|
||||
'platform_certs' => (Env::get('wechat.pub_key_id') && is_file(APP_PATH . 'extra/cert/wechatpay_pub.pem'))
|
||||
? [Env::get('wechat.pub_key_id') => APP_PATH . 'extra/cert/wechatpay_pub.pem']
|
||||
: [],
|
||||
// 支付结果通知地址(也可在下单时单独覆盖)
|
||||
'notify_url' => Env::get('app.url') . '/api/order/payNotify',
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user