Document-eSign-Docusign

 view release on metacpan or  search on metacpan

lib/Document/eSign/Docusign/buildCredentials.pm  view on Meta::CPAN

package Document::eSign::Docusign::buildCredentials;
use strict;
use warnings;
use XML::LibXML;
use JSON;

# Builds the auth credentials.

=head1 NAME

Document::eSign::Docusign::buildCredentials - Builds the credentials object.

=head1 VERSION

Version 0.02

=head1 functions

=head2 new($parent)

Builds an XML or JSON login string for the Docusign header. Setting "usejsononly" to a non-undef (null) in the constructor determines this behavior.

lib/Document/eSign/Docusign/sendRequest.pm  view on Meta::CPAN

=head1 NAME

Document::eSign::Docusign::sendRequest - Handles communication with DocuSign

=head1 VERSION

Version 0.02

=head1 functions

=head2 new($method, $contenttype, $credentials, $uri, $params, $query_params)

Handles communication with the Docusign API. Behavior adapts according to what is requested by a particular call.

=cut

sub new {
    carp( "Got send request: " . Dumper(@_) ) if $_[1]->debug;
    my $class        = shift;
    my $main         = shift;
    my $method       = shift;
    my $contenttype  = shift;
    my $credentials  = shift;
    my $uri          = shift;
    my $params       = shift;
    my $query_params = shift;

    my $self = bless {}, $class;

    my $ua = LWP::UserAgent->new(
        default_headers => HTTP::Headers->new(
            'X-DocuSign-Authentication' => $credentials,
            Accept                      => 'application/json',
        ),
    );

    $ua->add_handler( "request_send", sub { shift->dump; return } )
      if $main->debug;

    $ua->add_handler( "response_done", sub { shift->dump; return } )
      if $main->debug;



( run in 0.570 second using v1.01-cache-2.11-cpan-4d50c553e7e )