<?php

namespace App\Helper\UniPlatform\Kuaishou;

use App\Helper\UniPlatform\BaseAPI;

define('BASE_URL', 'https://open.kuaishou.com/oauth2');
define('PAY_URL', 'https://open.kuaishou.com/openapi/mp/developer');

final class KuaishouAPI extends BaseAPI
{
    /**
     * 获取 ACCESS_TOKEN.
     *
     * @url https://mp.kuaishou.com/docs/develop/server/getAccessToken.html
     */
    public const ACCESS_TOKEN = BASE_URL . '/access_token';

    /**
     * 登陆.
     *
     * @url https://mp.kuaishou.com/docs/develop/server/code2Session.html
     */
    public const LOGIN = BASE_URL . '/mp/code2session';

    /**
     * 支付下单.
     *
     * @url https://mp.kuaishou.com/docs/develop/server/epay/interfaceDefinition.html
     */
    public const CREATE_ORDER = PAY_URL . '/epay/create_order';

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

    /**
     * 同步订单.
     *
     * @url https://mp.kuaishou.com/docs/develop/server/order/push.html
     */
    public const ORDER_PUSH = PAY_URL . '/order/v1/report';

    /**
     * 结算.
     *
     * @url https://mp.kuaishou.com/docs/develop/server/epay/interfaceDefinition.html#_3%E3%80%81%E6%94%AF%E4%BB%98%E7%BB%93%E7%AE%97
     */
    public const SETTLE = PAY_URL . '/epay/settle';
}
