nidrax69/yousign-api-laravel
Composer 安装命令:
composer require nidrax69/yousign-api-laravel
包简介
Package for using YousignApi with laravel > 7.x
README 文档
README
It's a library for Laravel 7 and PHP7 Not tested on previous version.
Library to use YouSign API from doc (dev.yousign.com) with Laravel
Installation
Install using composer
Now require the lib
composer require nidrax69/yousign-api-laravel
Add provider in config.app
'providers' => [ Nidrax69\YousignApiLaravel\YousignApiLaravelServiceProvider::class, ]; 'aliases' => [ 'YousignApiLaravel' => Nidrax69\YousignApiLaravel\Facade\YousignApiLaravel::class, ];
Complete informations inside your .env file (contact YouSign to get Credentials) and then
YOUSIGN_KEY= YOUSIGN_API_URL=
Usage
Create Procedure with webhooks , files and members
use Nidrax69\YousignApiLaravel\YousignApiLaravel; class DocumentController extends Controller { public function sign(Request $request) { $client = new YousignApiLaravel(); // see all possibilities at https://dev.yousign.com/ $client->setProcedureKeyValue('name', 'Yousign'); $client->setProcedureKeyValue('description', 'Description procedure'); // to set default expiration date to the signature $client->setProcedureKeyValue('expiresAt', '2022-04-24'); // add webhooks // you can add different headers $webhookUrl = env('API_URL') . 'yousign/'; $client->addWebhook('member.finished', $webhookUrl . 'signature', 'GET', array( "X-Custom-Header" => $type . '-signature', )); $client->addWebhook('procedure.refused', $webhookUrl . 'refused', 'GET', array( "X-Custom-Header" => $type . '-signature', )); // procedure created but not ready for signature $procedure = $client->createProcedure(); // Allows you to define the content of SMS. {{code}} will be used to define the security code managed by Yousign. // up to 150 characters $client->addSmsContent('DIGITAL SIGNATURE - {{code}} is your security code to sign your documents.'); // add files to procedure $file = $client->addFile($namefile, $document->url, $procedure['id']); // add member to sign the documents $member = $client->addMember($user->firstname, $user->lastname, $user->email, $user->phone, $procedure['id']); // to determine the last page of your file $lastPageNumber = $this->getNumPagesInPDF($document->url); $reason = "Signed by " . $user->firstname . " " . $user->lastname . " (Yousign)"; // to determine position see https://placeit.yousign.fr/ $fileObject = $client->addFileObject($file['id'], $member['id'], $position, $reason, $lastPageNumber); // start the signature process $client->launchProcedure($procedure['id']); } }
Find the complete integration in source file
nidrax69/yousign-api-laravel 适用场景与选型建议
nidrax69/yousign-api-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.76k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 01 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nidrax69/yousign-api-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nidrax69/yousign-api-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-03