| 1 | package Document::eSign::Docusign::requestSignatureFromDocument; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | =head1 NAME | ||||||||||
| 8 | |||||||||||
| 9 | Document::eSign::Docusign::requestSignatureFromDocument - Uses a pdf document to create and send a new envelope. | ||||||||||
| 10 | |||||||||||
| 11 | =head1 VERSION | ||||||||||
| 12 | |||||||||||
| 13 | Version 0.02 | ||||||||||
| 14 | |||||||||||
| 15 | =cut | ||||||||||
| 16 | |||||||||||
| 17 | =head1 functions | ||||||||||
| 18 | |||||||||||
| 19 | =head2 requestSignatureFromDocument($parent, $vars) | ||||||||||
| 20 | |||||||||||
| 21 | Note that the arrayref of file names. This module tries to "DTRT" and | ||||||||||
| 22 | create a multipart post of each document you place in here. However, you may want to | ||||||||||
| 23 | consider the number of pages and resolution of what you are sending. Scanned documents | ||||||||||
| 24 | will be larger and therefore slower. If you have native PDF documents the upload will | ||||||||||
| 25 | be faster. (Not to mention a better presentation to the end signer.) The preceding | ||||||||||
| 26 | path to the documents will be stripped and docusign will only receive the resulting | ||||||||||
| 27 | filename. | ||||||||||
| 28 | |||||||||||
| 29 | my $response = $ds->requestSignatureFromTemplate( | ||||||||||
| 30 | { | ||||||||||
| 31 | emailSubject => 'Hello Signer World!', | ||||||||||
| 32 | emailBlurb => 'Please sign my document.', | ||||||||||
| 33 | documents => [ | ||||||||||
| 34 | { | ||||||||||
| 35 | documentId => 1, | ||||||||||
| 36 | name => '/path/to/some/file.pdf' | ||||||||||
| 37 | }, | ||||||||||
| 38 | { | ||||||||||
| 39 | documentId => 2, | ||||||||||
| 40 | name => '/path/to/some/otherfile.pdf' | ||||||||||
| 41 | } | ||||||||||
| 42 | ], | ||||||||||
| 43 | recipients => { | ||||||||||
| 44 | signers => [ | ||||||||||
| 45 | { | ||||||||||
| 46 | email => 'somebody@somedomain.org', | ||||||||||
| 47 | name => 'Joe Somebody', | ||||||||||
| 48 | recipientId => '1', | ||||||||||
| 49 | tabs => { | ||||||||||
| 50 | signHereTabs => [ | ||||||||||
| 51 | { | ||||||||||
| 52 | xPosition => "100", | ||||||||||
| 53 | yPosition => "100", | ||||||||||
| 54 | documentId => 1, | ||||||||||
| 55 | pageNumber => 1 | ||||||||||
| 56 | } | ||||||||||
| 57 | ] | ||||||||||
| 58 | } | ||||||||||
| 59 | } | ||||||||||
| 60 | ] | ||||||||||
| 61 | }, | ||||||||||
| 62 | status => 'sent' | ||||||||||
| 63 | } | ||||||||||
| 64 | ); | ||||||||||
| 65 | |||||||||||
| 66 | print "Got envelopeId: " . $response->{envelopeId} . "\n"; | ||||||||||
| 67 | |||||||||||
| 68 | For more complicated examples, refer to Docusign's API Documentation. | ||||||||||
| 69 | |||||||||||
| 70 | =cut | ||||||||||
| 71 | |||||||||||
| 72 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 73 | 0 | ▶ | carp("Got sign template request: " . Dumper(@_)) if $_[1]->debug; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 74 | 0 | my $class = shift; | |||||||||
| 75 | 0 | my $main = shift; | |||||||||
| 76 | 0 | my $vars = shift; | |||||||||
| 77 | 0 | my $documentfh = shift; | |||||||||
| 78 | |||||||||||
| 79 | 0 | my $self = bless {}, $class; | |||||||||
| 80 | |||||||||||
| 81 | 0 | my $uri = '/envelopes'; | |||||||||
| 82 | |||||||||||
| 83 | 0 | my $creds = $main->buildCredentials(); | |||||||||
| 84 | |||||||||||
| 85 | 0 | my $response = $main->sendRequest('POST', "multipart/form-data;boundary=snipsnip", $creds, $main->baseUrl . $uri, $vars); | |||||||||
| 86 | |||||||||||
| 87 | 0 | return $response; | |||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | |||||||||||
| 91 | 1 | 1; | |||||||||