Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Docusign Bundle Laravel Package

cyllene-web/docusign-bundle

View on GitHub
Deep Wiki
Context7

DocuSign Cyllene adaptation

eSignature

  • Possibility to place the signature based on a text anchor format.
// src/EventSubscriber/PreSignSubscriber.php
$envelopeBuilder->addAnchorSignatureZone(
    string $anchorString, 
    array $offsets = ["x_offset" => 1, "y_offset" => 3], 
    ?bool $isNotMandatory = false, 
    ?int $recipientId = null
)
  • Possibility of adding multiple documents for signature when calling the route to sign.
// src/Controller/MyController.php
return $this->redirectToRoute(
    'docusign_sign_name',
    [
        'paths' => [$filename,$filename2],
        'urls' => [
            $this->docusignUploadTmpDirectory.'/'.$filename,
            $this->docusignUploadTmpDirectory.'/'.$filename2
        ],
        'customIds' => [
            "custom1" => "custom data",
            "custom2" => $id // for callback
        ],
        'signerName' => "John doe",
        'signerEmail' => "email@example.com",
    ],
);

click

  • The bundle also allows for creating, modifying, and deleting clickwrap signatures.
# config/packages/docusign.yml
demo: "%kernel.debug%"
mode: clickwrap
auth_jwt:
    private_key: "Your private key"
    integration_key: "Your integration key%"
    user_guid: "Your user id%"
auth_clickwrap:
    api_account_id: "Your api account id %"
    clickwrap_id: "YourClickwrapId" // facultative
    user_guid: "Your user id"
  • The different methods to implement are as follows:

    1. Creating a new clickwrap
    // src/Service/AnyService.php
        $infos = [
            "name" => $filename,
            "path" => $documentPath
        ];
        $params = [
            // display_settings
            'consent_button_text', // optional
            'display_name', // optional
            'downloadable', // optional
            'format', // optional
            'has_decline_button', // optional
            'must_read', // optional
            'require_accept', // optional
            'document_display', // optional
            // document
            'document_name', // optional
            'order' // optional
        ];
        $response = $clickwrapRequester->createClickwrap($infos, $params);
        $myObject
            ->setClickwrapId($response["clickwrapId"])
            ->setClickwrapVersionId($response["versionId"])
        ;
    
    
    1. Updating an existing clickwrap

      // src/Service/AnyService.php
      $infos = [
          "name" => $filename,
          "path" => $documentPath
      ];
      
      $params = [
              // display_settings
              'consent_button_text', // optional
              'display_name', // optional
              'downloadable', // optional
              'format', // optional
              'has_decline_button', // optional
              'must_read', // optional
              'require_accept', // optional
              'document_display', // optional
              // document
              'document_name', // optional
              'order' // optional
          ];
      
      $clickwrapId = $myObject->getClickwrapId();
      $response = $clickwrapRequest->updateClickwrap($clickwrapId, $infos, ["display_name" => "Document name"])
      $myObject
         ->setClickwrapId($response["clickwrapId"])
         ->setClickwrapVersionId($response["versionId"])
      ;
      
    2. Remove an existing clickwrap

    // src/Service/AnyService.php
    $clickwrapId = $myObject->getClickwrapId();
    $response = $clickwrapRequest->deleteClickwrap($clickwrapId)
    return $response["status"] === "Deleted"
    
    
    1. Sign an existing clickwrap for user
    // src/Service/AnyService.php
    $params = [
        "fullname" => "Pierre Kiroul", // mandatory
        "email" => "Pierre-kiroul@example.com", // mandatory
        "clickwrapId" => "Here a clickwrap id", // mandatory
        'company' => "Your company", // optional
        'title' => "Your title", // optional
        "returnUrl" => "redirection url after signing", // optional
    ];
     $response = $clickwrapRequester->signClickwrap($params);
     if(null !== $response){
        //If the response is not null, everything went well, and you will find a URL in the response. 
        //You will need to redirect to this URL to continue the signing process on DocuSign.
     }
    
    1. Get a certificate of completion
    // src/Service/AnyService.php
    
    $response = $this->clickwrapRequester->getClickwrapAgreement(
              (string) $agreementId,
              (string) $clickwrapId
    );
    try {
       $fileContent = '';
       while (!$fileObject->eof()) {
          $fileContent .= $fileObject->fgets();
       }
    
       // Create response to view PDF
       $fileResponse = new Response($fileContent);
       $fileResponse->headers->set('Content-Type', 'application/pdf');
       $fileResponse->headers->set('Content-Disposition', 'inline; filename="document.pdf"');
       return $fileResponse;
    }
    catch(Exception $e){
      throw new \RuntimeException("Error while retrieving the agreement : ".$e);
    }
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
bugban/php-sdk
littlerocket/job-queue-bundle
graham-campbell/flysystem
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
directorytree/opensearch-client
directorytree/opensearch-adapter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php