robo-meister/accord-flow-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

robo-meister/accord-flow-api

Composer 安装命令:

composer require robo-meister/accord-flow-api

包简介

Lightweight PHP SDK for connecting to the AccordFlow Signature API.

README 文档

README

The AccordFlow PHP SDK is a small cURL-based client for connecting PHP 8.1+ applications to the AccordFlow Signature API. It supports JSON requests, multipart file uploads, bearer-token authentication, and the tenant header used by local open API mode.

Installation

Add the SDK to your application with Composer. For local development, reference this repository path:

composer config repositories.accordflow path ../signature/sdk/php
composer require robo-meister/accord-flow-api:*

The package requires the PHP curl and json extensions.

Quick start

<?php

require __DIR__ . '/vendor/autoload.php';

use AccordFlow\AccordFlowClient;

$client = new AccordFlowClient(
    baseUrl: 'http://localhost:8080',
    bearerToken: getenv('ACCORDFLOW_TOKEN') ?: null,
    tenantId: getenv('ACCORDFLOW_TENANT') ?: null,
);

$status = $client->status();

Sign JSON payloads

$response = $client->sign([
    'envelopeId' => 456,
    'data' => 'Hello world',
    'documentType' => 'txt',
    'profile' => [
        'countryCode' => 'PL',
        'type' => 'EXTERNAL',
        'mode' => 'RAW',
    ],
    'username' => 'demo',
    'consent' => [
        'accepted' => true,
        'method' => 'CHECKBOX',
    ],
]);

$signature = $response['signature'] ?? null;
$redirectUrl = $response['redirectUrl'] ?? null;

The signing endpoint requires an existing envelope. Create or look up the envelopeId before calling sign, and include an accepted consent payload so the API can capture signer consent evidence. Some providers return redirectUrl for browser-based handoff flows. Redirect the signer to that URL and store any returned verificationReference for later verification lookups.

Sign and verify files

$signed = $client->signFile('/path/to/document.pdf', 456, [
    'profileId' => 123,
]);

$verification = $client->verifyFile(
    '/path/to/document.pdf',
    $signed['signature'],
    ['profileId' => 123],
);

// File signing also requires an existing envelope ID; the helper sends the
// second argument as the multipart `envelopeId` form field.

Generic requests

Use the generic helpers when the SDK has not added a typed wrapper yet:

$usage = $client->get('/api/auth/usage/demo');
$createdUser = $client->post('/api/auth/signup', [
    'username' => 'demo',
    'password' => 'change-me',
]);

Error handling

Non-2xx responses and transport failures throw AccordFlowException. The exception includes the HTTP status code and decoded response body when the API returns JSON.

use AccordFlow\AccordFlowException;

try {
    $client->verify([
        'data' => 'Hello world',
        'signature' => $signature,
        'documentType' => 'txt',
        'username' => 'demo',
    ]);
} catch (AccordFlowException $error) {
    error_log($error->getMessage());
    error_log((string) $error->getStatusCode());
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-06-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固