<?php

namespace App\Helper\UniPlatform\Bytedance;

use App\Helper\UniPlatform\BaseAPI;

define('BASE_URL', 'https://developer.toutiao.com/api/apps/v2');
define('PAY_URL', 'https://developer.toutiao.com/api/apps');
final class ByteDanceAPI extends BaseAPI
{
    /**
     * 获取 ACCESS_TOKEN.
     *
     * @url https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/interface-request-credential/get-access-token
     */
    public const ACCESS_TOKEN = BASE_URL . '/token';

    /**
     * 登陆.
     *
     * @url https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/log-in/code-2-session
     */
    public const LOGIN = BASE_URL . '/jscode2session';

    /**
     * 支付下单.
     *
     * @url https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/ecpay/introduction
     */
    public const CREATE_ORDER = PAY_URL . '/ecpay/v1/create_order';

    /**
     * 订单同步.
     *
     * @url https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/ecpay/order/order-sync/
     */
    public const ORDER_PUSH = PAY_URL . '/order/v2/push';

    /**
     * 生成二维码
     *
     * @url https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/qr-code/create-qr-code
     */
    public const CREATE_QRCODE = PAY_URL . '/qrcode';

    /**
     * 结算.
     *
     * @url https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/ecpay/settlements/settlement/
     */
    public const SETTLE = PAY_URL . '/ecpay/v1/settle';
}
