12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- return [
- /*
- * 授权相关配置
- */
- 'auth' => [
- 'cache_prefix' => 'wechat_auth_state:',
- 'cache_ttl' => 600, // 10分钟
- 'default_scope' => 'snsapi_userinfo',
- ],
- /*
- * 默认配置,将会合并到各模块中
- */
- 'defaults' => [
- /*
- * 指定 API 调用返回结果的类型:array(default)/object/raw/自定义类名
- */
- 'response_type' => 'array',
- /*
- * 使用 Laravel 的缓存系统
- */
- 'use_laravel_cache' => true,
- /*
- * 日志配置
- */
- 'log' => [
- 'default' => 'single',
- 'channels' => [
- 'single' => [
- 'driver' => 'single',
- 'path' => storage_path('logs/wechat.log'),
- 'level' => 'debug',
- ],
- ],
- ],
- ],
- /*
- * 公众号
- */
- 'official_account' => [
- 'default' => [
- 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', ''), // AppID
- 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', ''), // AppSecret
- 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', ''), // Token
- 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''), // EncodingAESKey
- /**
- * OAuth 配置
- */
- 'oauth' => [
- 'scopes' => ['snsapi_userinfo'],
- 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/oauth_callback'),
- ],
- /**
- * 接口请求相关配置,超时时间等,具体可用参数请参考:
- * https://github.com/symfony/symfony/blob/5.3/src/Symfony/Contracts/HttpClient/HttpClientInterface.php
- */
- 'http' => [
- 'timeout' => 5.0,
- 'retry' => true,
- 'retry_delay' => 500,
- 'max_retries' => 1,
- ],
- ],
- ],
- 'pay' => [
- 'default' => [
- 'mch_id' => env('WECHAT_PAY_MCH_ID'), // 商户号
- 'secret_key' => env('WECHAT_PAY_KEY'), // API v3密钥
- 'certificate_serial_no' => env('WECHAT_PAY_SERIAL_NO'), // 商户证书序列号
- 'private_key' => storage_path('app/certs/wechat/apiclient_key.pem'), // 商户私钥
- 'certificate' => storage_path('app/certs/wechat/apiclient_cert.pem'), // 商户证书
- 'platform_certs' => [
- storage_path('app/certs/wechat/platform_cert.pem')
- ], // 平台证书
- 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID'), // 公众号 app_id
- 'notify_url' => env('WECHAT_PAY_NOTIFY_URL'), // 回调地址
- 'refund_notify_url' => env('WECHAT_REFUND_NOTIFY_URL'), // 退款回调地址
- ]
- ]
- ];
|