wechat.php 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. 'level' => env('WECHAT_LOG_LEVEL', 'debug'),
  32. 'file' => env('WECHAT_LOG_FILE', storage_path('logs/wechat.log')),
  33. ],
  34. ],
  35. /*
  36. * 路由配置
  37. */
  38. 'route' => [
  39. /*
  40. * 开放平台第三方平台路由配置
  41. */
  42. // 'open_platform' => [
  43. // 'uri' => 'serve',
  44. // 'action' => Overtrue\LaravelWeChat\Controllers\OpenPlatformController::class,
  45. // 'attributes' => [
  46. // 'prefix' => 'open-platform',
  47. // 'middleware' => null,
  48. // ],
  49. // ],
  50. ],
  51. /*
  52. * 公众号
  53. */
  54. 'official_account' => [
  55. 'ximengnaikang' => [//西蒙耐抗
  56. 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'wx22dc4d8cbc0a192d'), // 测试AppID
  57. 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'c79e6d7f3ba6ca9b5e42421923f17824'), // AppSecret
  58. 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', ''), // Token
  59. 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', 'vCHY5IdYC8fGzs4Hc7jDx4dO1xhzfkXxmwuRiw9cBwx'),
  60. ],
  61. 'jiuweiyun' => [
  62. //测试
  63. 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'wxd684a5cf4af0a810'), // AppID
  64. 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', '60d4420ae0bd70597621808b09934ff2'), // AppSecret
  65. 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'daweiboshi'), // Token
  66. 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', 'vCHY5IdYC8fGzs4Hc7jDx4dO1xhzfkXxmwuRiw9cBwx'),
  67. ],
  68. 'daweiboshi' => [
  69. 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'wx5224793b7dc7f7b7'), // 线上AppID
  70. 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', '400c15dfd1338b941341993afa651ca6'), // AppSecret
  71. 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'DavidWechat'), // Token
  72. 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', 'MmRfn5oyd3IjtJbVbTzfil232AERUSnc0z4nqIiZC57'),
  73. ],
  74. 'default' => [
  75. 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'wx2d43c63789323978'), // AppID
  76. 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'd7a3fe5f5a8f41c5a534ca1da9fc7cf0'), // AppSecret
  77. 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', ''), // Token // EncodingAESKey
  78. 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''), // EncodingAESKey
  79. 'response_type' => 'array',
  80. /**
  81. * 日志配置
  82. *
  83. * level: 日志级别, 可选为:
  84. * debug/info/notice/warning/error/critical/alert/emergency
  85. * path:日志文件位置(绝对路径!!!),要求可写权限
  86. */
  87. 'log' => [
  88. 'default' => 'dev', // 默认使用的 channel,生产环境可以改为下面的 prod
  89. 'channels' => [
  90. // 测试环境
  91. 'dev' => [
  92. 'driver' => 'single',
  93. 'path' => '/tmp/easywechat.log',
  94. 'level' => 'debug',
  95. ],
  96. // 生产环境
  97. 'prod' => [
  98. 'driver' => 'daily',
  99. 'path' => '/tmp/easywechat.log',
  100. 'level' => 'debug',
  101. ],
  102. ],
  103. ],
  104. /**
  105. * 接口请求相关配置,超时时间等,具体可用参数请参考:
  106. * http://docs.guzzlephp.org/en/stable/request-config.html
  107. *
  108. * - retries: 重试次数,默认 1,指定当 http 请求失败时重试的次数。
  109. * - retry_delay: 重试延迟间隔(单位:ms),默认 500
  110. * - log_template: 指定 HTTP 日志模板,请参考:https://github.com/guzzle/guzzle/blob/master/src/MessageFormatter.php
  111. */
  112. 'http' => [
  113. 'max_retries' => 10,
  114. 'retry_delay' => 50,
  115. 'timeout' => 5.0,
  116. // 'base_uri' => 'https://api.weixin.qq.com/', // 如果你在国外想要覆盖默认的 url 的时候才使用,根据不同的模块配置不同的 uri
  117. ],
  118. /*
  119. * OAuth 配置
  120. *
  121. * scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
  122. * callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。)
  123. */
  124. // 'oauth' => [
  125. // 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
  126. // 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
  127. // ],
  128. ],
  129. ],
  130. /*
  131. * 开放平台第三方平台
  132. */
  133. 'open_platform' => [
  134. 'default' => [
  135. 'app_id' => env('WECHAT_OPEN_PLATFORM_APPID', ''),
  136. 'secret' => env('WECHAT_OPEN_PLATFORM_SECRET', ''),
  137. 'token' => env('WECHAT_OPEN_PLATFORM_TOKEN', ''),
  138. 'aes_key' => env('WECHAT_OPEN_PLATFORM_AES_KEY', ''),
  139. ],
  140. ],
  141. /*
  142. * 小程序
  143. */
  144. 'mini_program' => [
  145. 'default' => [
  146. 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', 'wxf536016d4923e584'),
  147. 'secret' => env('WECHAT_MINI_PROGRAM_SECRET', '553f627cbb015f51b49edc153ed5f493'),
  148. 'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
  149. 'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
  150. ],
  151. ],
  152. /*
  153. * 微信支付
  154. */
  155. 'payment' => [
  156. // 'default' => [
  157. // 'sandbox'=> env('WECHAT_PAYMENT_SANDBOX', false),
  158. // 'app_id'=> env('WECHAT_PAYMENT_APPID', 'wx22dc4d8cbc0a192d'),
  159. // //设置Api密钥
  160. // 'key'=> env('WECHAT_PAYMENT_KEY', 'i5fcaqSNELvVdf2wHqoSvJcBPUEzEQCZ'),
  161. // //商户平台API安全证书中下载,保存到服务器// XXX: 绝对路径!!!!
  162. // 'cert_path'=> env('WECHAT_PAYMENT_CERT_PATH', '/www/wwwroot/ceshi.api.woaidakele.cn/test-h5/xmnk_api_cert/apiclient_cert.pem'),
  163. // 'key_path'=> env('WECHAT_PAYMENT_KEY_PATH', '/www/wwwroot/ceshi.api.woaidakele.cn/test-h5/xmnk_api_cert/apiclient_key.pem'),
  164. // //服务商的商户号
  165. // 'mch_id'=> env('WECHAT_PAYMENT_MCH_ID', '1604585534'),
  166. // //APIv3密钥,商户平台API安全中获取
  167. // 'api_v3'=> env('WECHAT_PAYMENT_API_V3', 'plHeJH0LoCrHXMxxgtJD2rlGzkL7Xmpv'),
  168. // //商户证书的序列号,可在微信商户平台API安全 中获取
  169. // 'serial_no'=> env('WECHAT_PAYMENT_SERIAL_NO', '73024BD5FA3E83F39DC1EE36D53FF206F6B82289'),
  170. // //获取的文件临时保存到服务器
  171. // 'cert_pem'=> env('WECHAT_PAYMENT_CERT_PEM','/www/wwwroot/ceshi.api.woaidakele.cn/test-h5/cert/cert.pem'),
  172. // 'notify_url'=> 'http://ceshi.api.woaidakele.cn/payments/wechat-notify', // 默认支付结果通知地址
  173. // ],
  174. 'default' => [
  175. 'sandbox' => env('WECHAT_PAYMENT_SANDBOX', false),
  176. 'app_id' => env('WECHAT_PAYMENT_APPID', 'wx5224793b7dc7f7b7'),
  177. 'mch_id' => env('WECHAT_PAYMENT_MCH_ID', '1603992271'),
  178. 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', '400c15dfd1338b941341993afa651ca6'),
  179. 'key' => env('WECHAT_PAYMENT_KEY', 'GiB0bJNdF2QPpMZEL1qG2dMbv5V095nF'),
  180. 'api_v3' => env('WECHAT_PAYMENT_API_V3', 'plHeJH0LoCrHXMxxgtJD2rlGzkL7Xmpv'),
  181. 'serial_no' => env('WECHAT_PAYMENT_SERIAL_NO', '696B623841134292AAB48D4EC5907FB376504E98'),
  182. 'cert_path' => env('WECHAT_PAYMENT_CERT_PATH', '/www/wwwroot/api.app.jiuweiyun.cn/app-api/jwy_api_cert/apiclient_cert.pem'), // XXX: 绝对路径!!!!
  183. 'key_path' => env('WECHAT_PAYMENT_KEY_PATH', '/www/wwwroot/api.app.jiuweiyun.cn/app-api/jwy_api_cert/apiclient_key.pem'), // XXX: 绝对路径!!!!
  184. 'cert_pem' => env('WECHAT_PAYMENT_CERT_PEM','/www/wwwroot/api.app.jiuweiyun.cn/app-api/cert/cert.pem'),
  185. 'notify_url' => 'http://api.app.jiuweiyun.cn/payments/wechat-notify', // 默认支付结果通知地址
  186. ],
  187. ],
  188. /*
  189. * 企业微信
  190. */
  191. // 'work' => [
  192. // 'default' => [
  193. // 'corp_id' => 'xxxxxxxxxxxxxxxxx',
  194. // 'agent_id' => 100020,
  195. // 'secret' => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''),
  196. // //...
  197. // ],
  198. // ],
  199. ];