wechat.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. # 小程序基本配置
  3. $config['type'] = 3;
  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['send_msg'] = array
  24. (
  25. 'name' => '发送模板消息',
  26. 'method' => 'post',
  27. 'json' => true,
  28. 'url' => 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?',
  29. 'param' => array
  30. (
  31. 'access_token' => 'token',
  32. 'touser' => 'touser',
  33. 'template_id' => 'template_id',
  34. 'page' => 'page',
  35. 'form_id' => 'form_id',
  36. 'data' => 'data',
  37. 'emphasis_keyword' => 'emphasis_keyword',
  38. ),
  39. //针对一些返回的名称,做转换
  40. 'response' => array
  41. (
  42. ),
  43. );
  44. $config['get_msg'] = array
  45. (
  46. 'name' => '获取帐号下已存在的模板列表',
  47. 'method' => 'post',
  48. 'json' => true,
  49. 'url' => 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?',
  50. 'param' => array
  51. (
  52. 'access_token' => 'token',
  53. 'offset' => '0',
  54. 'count' => '20',
  55. ),
  56. //针对一些返回的名称,做转换
  57. 'response' => array
  58. (
  59. ),
  60. );
  61. return $config;