wechat.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. // 'app_id' => 'wx660b94f751a78b61',
  12. // 'secret' => '58b3edd89e4d95516cff598e1b60b5d8',
  13. //'level' => 'error',
  14. //主域名
  15. //'app_url' => env('APP_URL','admin.weilaibike.dev.hanyiyun.com'),
  16. // 二维码链接路径
  17. 'code_url' => env('WECHAT_CODE_URL', 'http://code.weilaibike.com?no='),
  18. /*
  19. * 默认配置,将会合并到各模块中
  20. */
  21. 'defaults' => [
  22. /*
  23. * 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
  24. */
  25. 'response_type' => 'array',
  26. /*
  27. * 使用 Laravel 的缓存系统
  28. */
  29. 'use_laravel_cache' => true,
  30. /*
  31. * 日志配置
  32. *
  33. * level: 日志级别,可选为:
  34. * debug/info/notice/warning/error/critical/alert/emergency
  35. * file:日志文件位置(绝对路径!!!),要求可写权限
  36. */
  37. 'log' => [
  38. 'level' => env('WECHAT_LOG_LEVEL', 'debug'),
  39. 'file' => env('WECHAT_LOG_FILE', storage_path('logs/wechat.log')),
  40. ],
  41. ],
  42. /*
  43. * 路由配置
  44. */
  45. 'route' => [
  46. /*
  47. * 开放平台第三方平台路由配置
  48. */
  49. // 'open_platform' => [
  50. // 'uri' => 'serve',
  51. // 'action' => Overtrue\LaravelWeChat\Controllers\OpenPlatformController::class,
  52. // 'attributes' => [
  53. // 'prefix' => 'open-platform',
  54. // 'middleware' => null,
  55. // ],
  56. // ],
  57. ],
  58. /*
  59. * 公众号
  60. */
  61. 'official_account' => [
  62. 'default' => [
  63. 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'your-app-id'), // AppID
  64. 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'your-app-secret'), // AppSecret
  65. 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'your-token'), // Token
  66. 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''), // EncodingAESKey
  67. /*
  68. * OAuth 配置
  69. *
  70. * scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
  71. * callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。)
  72. */
  73. // 'oauth' => [
  74. // 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
  75. // 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
  76. // ],
  77. ],
  78. ],
  79. /*
  80. * 开放平台第三方平台
  81. */
  82. // 'open_platform' => [
  83. // 'default' => [
  84. // 'app_id' => env('WECHAT_OPEN_PLATFORM_APPID', ''),
  85. // 'secret' => env('WECHAT_OPEN_PLATFORM_SECRET', ''),
  86. // 'token' => env('WECHAT_OPEN_PLATFORM_TOKEN', ''),
  87. // 'aes_key' => env('WECHAT_OPEN_PLATFORM_AES_KEY', ''),
  88. // ],
  89. // ],
  90. /*
  91. * 小程序
  92. */
  93. 'mini_program' => [
  94. 'default' => [
  95. 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''),
  96. 'secret' => env('WECHAT_MINI_PROGRAM_SECRET', ''),
  97. 'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
  98. 'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
  99. ],
  100. 'message_template' => [
  101. 'to_be_paid' => 'CBp8jWZHVOQBIB7_n4EHuAjmFz2XlIzZY1yjQJESJT0', // 待支付模板
  102. 'refund' => 'rV85SkGp7Q508xXz45ycQw8nTN_2VEB7m_GhR-WrCDY', // 退款模板
  103. ]
  104. ],
  105. /*
  106. * 微信支付
  107. */
  108. 'payment' => [
  109. 'default' => [
  110. 'sandbox' => env('WECHAT_PAYMENT_SANDBOX', false),
  111. 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''),
  112. 'mch_id' => env('WECHAT_MINI_PROGRAM_PAY_MCH_ID', ''),
  113. 'key' => env('WECHAT_MINI_PROGRAM_PAY_MCH_KEY', ''),
  114. 'cert_path' => base_path() . '/yufengjiayun_20200814_cert/apiclient_cert.pem', // XXX: 绝对路径!!!!
  115. 'key_path' => base_path() . '/yufengjiayun_20200814_cert/apiclient_key.pem', // XXX: 绝对路径!!!!
  116. 'notify_url' => env('APP_API_URL') . '/api/payments/wechat-notify', // 默认支付结果通知地址
  117. ],
  118. // 押金退还回调地址
  119. 'refund_deposit_notify_url' => env('APP_API_URL') . '/api/payments/wechat-refund-notify', // 此处回调直接使用小程序退款回调
  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. ];