wechat.php 852 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. # 公众号基本配置
  3. $config['type'] = 2;
  4. $config['token'] = array
  5. (
  6. 'name' => '获取公众号的token',
  7. 'method' => 'get',
  8. 'json' => false,
  9. 'url' => 'https://api.weixin.qq.com/cgi-bin/token?',
  10. 'param' => array
  11. (
  12. 'appid' => 'appid',
  13. 'secret' => 'secret',
  14. 'grant_type' => 'client_credential',
  15. ),
  16. //针对一些返回的名称,做转换
  17. 'response' => array
  18. (
  19. 'access_token' => 'token',
  20. 'expires_in' => 'expires_in',
  21. ),
  22. );
  23. $config['ticket'] = array
  24. (
  25. 'name' => '获取公众号的ticket',
  26. 'method' => 'get',
  27. 'json' => false,
  28. 'url' => 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?',
  29. 'param' => array
  30. (
  31. 'type' => 'jsapi',
  32. 'access_token' => 'token',
  33. ),
  34. //针对一些返回的名称,做转换
  35. 'response' => array
  36. (
  37. 'jsapi_ticket' => 'ticket',
  38. 'expires_in' => 'expires_in',
  39. ),
  40. );
  41. return $config;