laulamanapps/document-signer-docusign
Composer 安装命令:
composer require laulamanapps/document-signer-docusign
包简介
DocuSign eSignature implementation of the document signer SDK.
README 文档
README
DocuSign eSignature implementation of the
SignatureProvider contract from
laulamanapps/document-signer-sdk.
Uses the OAuth 2.0 JWT user-consent grant to authenticate — no per-call user interaction once the integration user has granted consent.
Install
composer require laulamanapps/document-signer-docusign
Quick start
use LauLamanApps\DocumentSigner\Sdk\Document\Document; use LauLamanApps\DocumentSigner\Sdk\Envelope\Envelope; use LauLamanApps\DocumentSigner\Sdk\Signer\Signer; use LauLamanApps\DocumentSigner\DocuSign\DocuSignConfig; use LauLamanApps\DocumentSigner\DocuSign\DocuSignProvider; $provider = new DocuSignProvider(new DocuSignConfig( integrationKey: getenv('DOCUSIGN_INTEGRATION_KEY'), userId: getenv('DOCUSIGN_USER_ID'), accountId: getenv('DOCUSIGN_ACCOUNT_ID'), privateKey: file_get_contents('/path/to/private.pem'), oauthBaseUrl: 'account-d.docusign.com', // 'account.docusign.com' in prod apiBaseUrl: 'https://demo.docusign.net/restapi', // production URL from userinfo )); $receipt = $provider->send(new Envelope( name: 'Statement of Work', documents: [new Document( id: 'sow', name: 'SoW', html: '<p>{[signature:customer:sig]} on {[date:customer:signdate]}</p>', )], signers: [new Signer(key: 'customer', name: 'Jane Doe', email: 'jane@example.com')], emailSubject: 'Please sign the SoW', )); echo $receipt->provider; // "docusign" (DocuSignProvider::NAME) echo $receipt->providerEnvelopeId; // DocuSign envelopeId GUID
What it does
For every document in the envelope, this package:
- Parses
{[type:signer:name]}placeholders out of the HTML. - Substitutes each one with a hidden anchor token (
**DS:type:signer:name**). - Renders the HTML to PDF via the SDK's
PdfRenderer. - Base64-encodes each PDF and POSTs the envelope to
POST /v2.1/accounts/{accountId}/envelopeswith one anchor tab per placeholder under the correct recipient. - Returns an
EnvelopeReceiptcontaining the DocuSign envelopeId and a normalisedEnvelopeStatus.
Access tokens are minted via JWT and cached in memory by DocuSignJwtAuth
until 60s before expiry. Reuse one DocuSignProvider per process.
Field mapping
SDK FieldType |
DocuSign tab bucket |
|---|---|
Signature |
signHereTabs |
Initials |
initialHereTabs |
Text |
textTabs |
Date |
dateSignedTabs |
Checkbox |
checkboxTabs |
One-time setup: user consent
The first time the integration key impersonates a user, the user must approve consent in a browser:
https://account-d.docusign.com/oauth/auth
?response_type=code
&scope=signature%20impersonation
&client_id=YOUR_INTEGRATION_KEY
&redirect_uri=https://www.docusign.com
Use account.docusign.com in production. After consent, JWT exchange runs
non-interactively from then on.
Requirements
- PHP 8.5
laulamanapps/documentsigner-sdkfirebase/php-jwt(pulled automatically)- A DocuSign developer/production account, integration key, RSA key pair, and the impersonated user's GUID
- Node.js + Puppeteer (for the default Browsershot renderer)
Documentation
The full provider guide — credentials, JWT setup, demo vs prod URLs, endpoint mapping, status mapping, sequential signing, token caching, troubleshooting — lives in the SDK's docs:
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: proprietary
- 更新时间: 2026-06-30