Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (45 sloc) 1.768 kb
2af0086 @texel Added copyright, some rudimentary documentation.
authored
1 # Copyright (C) DocuSign, Inc. All rights reserved.
2 #
3 # This source code is intended only as a supplement to DocuSign SDK
4 # and/or on-line documentation.
5 #
6 # This sample is designed to demonstrate DocuSign features and is not intended
7 # for production use. Code and policy for a production application must be
8 # developed to meet the specific data and security requirements of the
9 # application.
10 #
11 # THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
12 # KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13 # IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
14 # PARTICULAR PURPOSE.
15
d08b50a @texel Generated proxy classes and got base working. Ok just kidding- nothing r...
authored
16 module Docusign
17 class Base
18
a6332a5 @texel Made configuration a little more flexible
authored
19 class << self
20 def login(options={})
21
5d572a0 @texel Finally got basic functionality working!
authored
22 connection = Docusign::APIServiceSoap.new
acaddd9 @texel Support for integrator Key.
authored
23
e32aa20 @texel Maybe now the header will actually send
authored
24 if options[:integrators_key]
36b8481 @texel Given an integrators key, the proper header handler is now sent.
authored
25 header = IntegratorsKeyAuthHeaderHandler.new(
26 :email => options.delete(:email),
27 :integrators_key => options.delete(:integrators_key),
28 :password => options.delete(:password)
acaddd9 @texel Support for integrator Key.
authored
29 )
30 else
31 header = AuthHeaderHandler.new(
32 :user_name => options.delete(:user_name),
33 :password => options.delete(:password)
34 )
35 end
5d572a0 @texel Finally got basic functionality working!
authored
36
37 connection.headerhandler << header
38
a6332a5 @texel Made configuration a little more flexible
authored
39 options.each do |key, value|
40 connection.send("#{key}=", value)
41 end
42
5d572a0 @texel Finally got basic functionality working!
authored
43 connection
44 end
ee3595a @texel Incremented version and included credential API
authored
45
46 def credentials(email, password, endpoint_url=nil)
47
48 connection = Docusign::Credential::CredentialSoap.new
49 connection.endpoint_url = endpoint_url if endpoint_url
50
51 connection.login(:email => email, :password => password).loginResult
52 end
d08b50a @texel Generated proxy classes and got base working. Ok just kidding- nothing r...
authored
53 end
54 end
55 end
Something went wrong with that request. Please try again.