JsApiTest.php 634 B

12345678910111213141516171819202122232425262728293031
  1. <?php /*
  2. * Copyright (C) 2017 All rights reserved.
  3. *
  4. * @File JsApiTest.php
  5. * @Brief
  6. * @Author abelzhu, abelzhu@tencent.com
  7. * @Version 1.0
  8. * @Date 2017-12-26
  9. *
  10. */
  11. include_once("../src/CorpAPI.class.php");
  12. include_once("../src/ServiceCorpAPI.class.php");
  13. include_once("../src/ServiceProviderAPI.class.php");
  14. //
  15. $config = require('./config.php');
  16. //
  17. $api = new CorpAPI($config['CORP_ID'], $config['APP_SECRET']);
  18. try {
  19. //
  20. $ticket = $api->TicketGet();
  21. echo $ticket . "\n";
  22. //
  23. $ticket = $api->JsApiTicketGet();
  24. echo $ticket . "\n";
  25. } catch (Exception $e) {
  26. echo $e->getMessage() . "\n";
  27. }