wechat.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?php
  2. /*
  3. * This file is part of the overtrue/laravel-wechat.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. return [
  11. /*
  12. * 默认配置,将会合并到各模块中
  13. */
  14. 'defaults' => [
  15. /*
  16. * 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
  17. */
  18. 'response_type' => 'array',
  19. /*
  20. * 使用 Laravel 的缓存系统
  21. */
  22. 'use_laravel_cache' => true,
  23. /*
  24. * 日志配置
  25. *
  26. * level: 日志级别,可选为:
  27. * debug/info/notice/warning/error/critical/alert/emergency
  28. * file:日志文件位置(绝对路径!!!),要求可写权限
  29. */
  30. 'log' => [
  31. 'default' => env('APP_DEBUG', false) ? 'dev' : 'prod', // 默认使用的 channel,生产环境可以改为下面的 prod
  32. 'channels' => [
  33. // 测试环境
  34. 'dev' => [
  35. 'driver' => 'single',
  36. 'path' => '/tmp/easywechat.log',
  37. 'level' => 'debug',
  38. ],
  39. // 生产环境
  40. 'prod' => [
  41. 'driver' => 'daily',
  42. 'path' => '/tmp/easywechat.log',
  43. 'level' => 'info',
  44. ],
  45. ],
  46. ],
  47. ],
  48. /*
  49. * 路由配置
  50. */
  51. 'route' => [
  52. /*
  53. * 开放平台第三方平台路由配置
  54. */
  55. // 'open_platform' => [
  56. // 'uri' => 'serve',
  57. // 'action' => Overtrue\LaravelWeChat\Controllers\OpenPlatformController::class,
  58. // 'attributes' => [
  59. // 'prefix' => 'open-platform',
  60. // 'middleware' => null,
  61. // ],
  62. // ],
  63. ],
  64. /*
  65. * 公众号
  66. */
  67. 'official_account' => [
  68. 'default' => [
  69. 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'your-app-id'), // AppID
  70. 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'your-app-secret'), // AppSecret
  71. 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'your-token'), // Token
  72. 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''), // EncodingAESKey
  73. /*
  74. * OAuth 配置
  75. *
  76. * scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
  77. * callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。)
  78. */
  79. // 'oauth' => [
  80. // 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
  81. // 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
  82. // ],
  83. ],
  84. ],
  85. /*
  86. * 开放平台第三方平台
  87. */
  88. // 'open_platform' => [
  89. // 'default' => [
  90. // 'app_id' => env('WECHAT_OPEN_PLATFORM_APPID', ''),
  91. // 'secret' => env('WECHAT_OPEN_PLATFORM_SECRET', ''),
  92. // 'token' => env('WECHAT_OPEN_PLATFORM_TOKEN', ''),
  93. // 'aes_key' => env('WECHAT_OPEN_PLATFORM_AES_KEY', ''),
  94. // ],
  95. // ],
  96. /*
  97. * 小程序
  98. */
  99. 'mini_program' => [
  100. 'default' => [
  101. 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', 'wx3754a6dff0617069'),
  102. 'secret' => env('WECHAT_MINI_PROGRAM_SECRET', '4369368ff6ca1c79812a0485c4edd3df'),
  103. 'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
  104. 'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
  105. ],
  106. ],
  107. /*
  108. * 微信支付
  109. */
  110. 'payment' => [
  111. 'default' => [
  112. 'sandbox' => env('WECHAT_PAYMENT_SANDBOX', false),
  113. 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''),
  114. 'mch_id' => env('WECHAT_MINI_PROGRAM_PAY_MCH_ID', ''),
  115. 'key' => env('WECHAT_MINI_PROGRAM_PAY_MCH_KEY', ''),
  116. 'cert_path' => base_path() . '/yufengjiayun_20200814_cert/apiclient_cert.pem', // XXX: 绝对路径!!!!
  117. 'key_path' => base_path() . '/yufengjiayun_20200814_cert/apiclient_key.pem', // XXX: 绝对路径!!!!
  118. 'notify_url' => env('APP_URL') . '/api/payments/wechat-notify', // 默认支付结果通知地址
  119. ],
  120. // ...
  121. ],
  122. /*
  123. * 企业微信
  124. */
  125. // 'work' => [
  126. // 'default' => [
  127. // 'corp_id' => 'xxxxxxxxxxxxxxxxx',
  128. // 'agent_id' => 100020,
  129. // 'secret' => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''),
  130. // //...
  131. // ],
  132. // ],
  133. ];