Files

55 lines
3.6 KiB
PHP
Raw Permalink Normal View History

2026-09-17 16:25:31 +08:00
<?php
use think\Env;
return [
'oss' => [
'access_key_id' => Env::get('oss.ACCESS_ID'),
'access_key_secret' => Env::get('oss.ACCESS_KEY'),
'endpoint' => Env::get('oss.ENDPOINT'),
'bucket' => Env::get('oss.BUCKET'),
'domain' => 'https://' . Env::get('oss.BUCKET') . '.oss-cn-shenzhen.aliyuncs.com/',
],
'wechat' => [
2026-09-21 14:57:50 +08:00
// 小程序
'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证书 绝对路径
2026-09-22 11:16:56 +08:00
// 微信支付公钥模式(2024Q3+ 推荐): 公钥ID以 PUB_KEY_ID_ 开头, 公钥文件存放于 extra/cert/pub_key.pem
2026-09-21 14:57:50 +08:00
// 两者都配置后无需再下载平台证书
2026-09-22 11:16:56 +08:00
'platform_certs' => (Env::get('wechat.pub_key_id') && is_file(APP_PATH . 'extra/cert/pub_key.pem'))
? [Env::get('wechat.pub_key_id') => APP_PATH . 'extra/cert/pub_key.pem']
2026-09-21 14:57:50 +08:00
: [],
// 支付结果通知地址(也可在下单时单独覆盖)
'notify_url' => Env::get('app.url') . '/api/order/payNotify',
2026-10-10 14:10:14 +08:00
// 新版商家转账(用户确认模式)转账场景ID:1005=佣金报酬
'transfer_scene_id' => Env::get('wechat.transfer_scene_id', '1005'),
2026-10-10 14:52:18 +08:00
// 转账场景报备信息:必须与 transfer_scene_id 严格对应,否则报「未传入完整且对应的转账场景报备信息」
// 1005(佣金报酬) 固定传两条:岗位类型 + 报酬说明;info_type ≤15 字符,info_content ≤32 字符,且 info_type 不可重复
'transfer_scene_report_infos' => [
['info_type' => '岗位类型', 'info_content' => '平台接单用户'],
['info_type' => '报酬说明', 'info_content' => '用户提现'],
],
2026-10-10 14:10:14 +08:00
// 新版商家转账结果回调地址(公网可访问、HTTPS、不带参数)
'transfer_notify_url' => Env::get('app.url') . '/api/account/transferNotify',
// 免确认收款授权结果回调地址(公网可访问、HTTPS、不带参数)
'transfer_authorization_notify_url' => Env::get('app.url') . '/api/account/transferAuthorizationNotify',
2026-09-17 16:25:31 +08:00
],
2026-10-27 16:19:46 +08:00
// 小程序虚拟支付(类目不支持普通微信支付时使用)
2026-10-27 18:30:40 +08:00
// 代币比例须与 MP「虚拟支付-代币配置」一致:1元=1代币。数量保留两位小数,0.01元=0.01代币
2026-10-22 15:41:39 +08:00
'virtual_pay' => [
2026-10-27 16:19:46 +08:00
'offer_id' => Env::get('wechat.vp_offer_id', ''),
'app_key' => Env::get('wechat.vp_app_key', ''), // 现网 AppKey,env=0
'sandbox_app_key' => Env::get('wechat.vp_sandbox_app_key', ''), // 沙箱 AppKey,env=1
'env' => (int)Env::get('wechat.vp_env', 0), // 0现网 1沙箱;正式版只能为 0
'coin_per_yuan' => (int)Env::get('wechat.vp_coin_per_yuan', 1),
'msg_token' => Env::get('wechat.vp_msg_token', ''), // 消息推送 Token
'aes_key' => Env::get('wechat.vp_aes_key', ''), // 消息推送 EncodingAESKey,明文模式可空
'android_pay_fees' => 0.01, //安卓支付费率
'ios_pay_fees' => 0.12, //ios支付费率
2026-10-22 15:41:39 +08:00
],
2026-09-17 16:25:31 +08:00
];