定制 wu/easy-verify-dy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wu/easy-verify-dy

Composer 安装命令:

composer require wu/easy-verify-dy

包简介

抖音核销

README 文档

README

License

easy verify 抖音模块.

接口清单

token 接口
团购核销接口
团购退款
订单查询接口
门店相关接口

使用示例

  • 安装
composer require wu/easy-verify-dy
  • 发布并配置
php artisan vendor:publish --provider="Wu\EasyVerifyDy\Providers\ServiceProvider"
token 接口
  • 生成 client-token
public function test_get_client_token()
{
    $res = new Application($this->token)->getClientToken();
    echo $res->getAccessToken(), PHP_EOL;
    echo $res->getExpiresIn(), PHP_EOL;
    echo Carbon::now()->addSeconds()->format('Y-m-d H:i:s'), PHP_EOL;
    echo Carbon::now()->addSeconds()->toDateTimeLocalString(), PHP_EOL;
}
团购核销接口
  • 验券准备-二维码短链提取 object_id
public function test_parsing()
{
    $string = new Application()->parsing("https://v.douyin.com/iQsX2aWL/");
    echo '二维码短链提取 object_id:', $string, PHP_EOL;
}
  • 验券准备-encrypted_data (object_id)
public function test_prepare_by_encrypt_data()
{
    $objectId = 'I08zVldiM1FKVU1Pc29uZmdoNTUxWGpCSExPVDJJVHJjTXZaakJkOEhEQWZ4enJSdlRZcFZPcWt3UDJ5WW1HMXVDUlVMVGJidFk1ajVzdUZMYndQYXVmQWxHaEV5OEl4MllsTFhOcnJvaHloY3dKUGZiS21iUjdoaU1WTC9uWjdKSFZWKytVQXNMRU1acTR1ZytiSUhRYStWL0YraDd5dVB4MlRqUHNnckxYeEZ4Zkt5am5qaEcvQ0lLZUJ0VnI1SXQrUGpyR0l2YUorbQ';
    $res = new Application($this->token)->prepare($objectId);
    echo $res->getLogId(), PHP_EOL;
    echo $res->getOrderId(), PHP_EOL;
    echo $res->getVerifyToken(), PHP_EOL;
    echo $res->getSkuTitle(), PHP_EOL;
    echo $res->getSkuGrouponType(), PHP_EOL;
    echo $res->getSkuId(), PHP_EOL;
}
  • 验券准备-code
public function test_prepare_by_code()
{
    $code = '121638498862402';
    $res = new Application($this->token)->prepareByCode($code);
    echo $res->getLogId(), PHP_EOL;
    echo $res->getOrderId(), PHP_EOL;
    echo $res->getVerifyToken(), PHP_EOL;
    echo $res->getSkuTitle(), PHP_EOL;
    echo $res->getSkuGrouponType(), PHP_EOL;
    echo $res->getSkuId(), PHP_EOL;
}
  • 验券
public function test_verify()
{
    $verifyToken = '563ac447-7368-431d-b38e-6f8c3e75109a';
    $encryptCode = 'CgYIASAHKAESLgosEBc7a1+TmVbom+Ro0XaTbSWcUCmqJmauIlqsas2IRXQQqRGOMEqxpBGz/KUaAA==';
    $storeId = '6726901086101276675';
    $res = new Application($this->token)->verify($verifyToken, [$encryptCode], $storeId);
    echo $res->getReason(), PHP_EOL;
    echo $res->getAccountId(), PHP_EOL;
    echo $res->getOrderId(), PHP_EOL;
    echo $res->getCertificateId(), PHP_EOL;
    echo $res->getVerifyId(), PHP_EOL;
    echo $res->getOriginCode(), PHP_EOL;
}
  • 撤销核销
public function test_cancel()
{
    $certId = '7513089961583886362';
    $verifyId = '7513110825529133096';

    $res = new Application($this->token)->cancel($certId, $verifyId);
    var_dump($res->getCancelResults());
    echo $res->getReason(), PHP_EOL;
}
  • 撤销核销-批量撤销次卡订单下的一批验券记录
public function test_times_card_cancel_batch()
{
    $params = [
        'order_id' => '1085741005608348523',
        'verify_id_list' => [
            '7513110825529133096',
        ]
    ];
    $res = new Application($this->token)->cancelBatch($params);
    var_dump($res->getCancelResults());
    echo $res->getReason(), PHP_EOL;
}
  • 券状态查询
public function test_code_query()
{
    $code = 'CgYIASAHKAESLgosGcK8ZgM/CvL/rhRBlKeLShVHvPuSbuwpQjONP8PlKtWEKJDFcB0N7cojZ44aAA==';
    $res = new Application($this->token)->codeQuery($code);
    echo $res->getReason(), PHP_EOL;
    echo $res->getStatus(), PHP_EOL;
    echo $res->getSkuId(), PHP_EOL;
    echo $res->getSkuTitle(), PHP_EOL;
    echo $res->getSkuGrouponType(), PHP_EOL;
    var_dump($res->getTimeCard());
    var_dump($res->getVerify());
}
  • 券状态批量查询
public function test_code_query_by_order_id()
{
    $code = '1085741005608348523';
    $res = new Application($this->token)->codeQueryByOrderId($code);
    echo $res->getReason(), PHP_EOL;
    var_dump($res->getCertificates());
}
团购退款
  • 售后单详情查询
public function test_refund_query()
{

    $certId = '7513089961583886362';
    $orderId = '1085741005608348523';
    $accountId = config('verify.dy.account_id');

    $res = new Application($this->token)->refundQuery($accountId, $orderId, $certId);
    var_dump($res->getReason());
    var_dump($res->getList());
}
  • 退款单列表查询
public function test_refund_list_query()
{

    $params = [
        'account_id' => config('verify.dy.account_id'),
        'page_size' => 2
    ];

    $res = new Application($this->token)->refundListQuery($params);
    var_dump($res->getReason());
    var_dump($res->getList());
}
  • 抖音码核销后退款审批
public function test_refund_audit()
{
    $accountId = config('verify.dy.account_id');
    $status = true;
    $certId = '7513089961583886362';
    $orderId = '1085741005608348523';
    $res = new Application($this->token)->refundAudit($accountId, $status, $orderId, $certId);
    var_dump($res->getReason());
    var_dump($res->isReentry());
}
  • 发起退款
public function test_refund_apply()
{
    $accountId = config('verify.dy.account_id');
    $refundCode = [
        3231251066750117689,
    ];
    $certIdList = ['AuPlFaur4a'];
    $codeList = ['Acc34S7XuI'];
    $orderId = 'P3tdpU7OMG';
    $res = new Application($this->token)->refundApply(
        $accountId,
        $orderId,
        $refundCode,
        reason: 'm5w94r0pG5',
        codeList: $codeList,
        certificateIdList: $certIdList,
        amount: 5258743426434471972,
        outAfterSaleId: '8AENsc2iMo'
    );
    var_dump($res->getReason());
    echo $res->isApplySuccess(), PHP_EOL;
    echo $res->getOrderId(), PHP_EOL;
    echo $res->getAfterSaleId(), PHP_EOL;
    var_dump($res->getAfterSaleInfoList());
}
订单查询接口
  • 订单查询
public function test_order_query()
{
    $params = [
        'page_num' => 1,
        'page_size' => 2,
        'account_id' => config('verify.dy.account_id'),
    ];
    $res = new Application($this->token)->orderQuery($params);
    echo count($res->getOrders()), PHP_EOL;
    var_dump($res->getOrders());
}
门店相关接口
  • 查询门店信息
public function test_store_query()
{
    $params = [
        'page_num' => 1,
        'page_size' => 2,
        'account_id' => config('verify.dy.account_id'),
    ];
    $res = new Application($this->token)->storeQuery($params);
    echo count($res->getStores()), PHP_EOL;
    var_dump($res->getStores());
}

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-29