ByteDanceAPI.php 775 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Helper\Bytedance;
  3. define('BASE_URL','https://developer.toutiao.com/api/apps/v2');
  4. define('PAY_URL','https://developer.toutiao.com/api/apps');
  5. final class ByteDanceAPI
  6. {
  7. /**
  8. * 获取 ACCESS_TOKEN
  9. * @url https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/interface-request-credential/get-access-token
  10. */
  11. const ACCESS_TOKEN = BASE_URL.'/token';
  12. /**
  13. * 登陆
  14. * @url https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/log-in/code-2-session
  15. */
  16. const LOGIN = BASE_URL.'/jscode2session';
  17. /**
  18. * 支付下单
  19. * @url https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/ecpay/introduction
  20. */
  21. const CREATE_ORDER = PAY_URL.'/ecpay/v1/create_order';
  22. }