docusign_rest 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -92,6 +92,8 @@ puts client.get_account_id
92
92
 
93
93
  **Creating an envelope from a document:**
94
94
 
95
+ Note: In the example below there are two sign here tabs for the user with a role of 'Attorney'. There are also two documents attached to the envelope, however, this exact configuration would only allow for signature on the first document. If you need signature for a second document, you'll need to add further options, namely: `document_id: 2` in one of the sign_here_tabs so that DocuSign knows where to embed that signature tab.
96
+
95
97
  ```ruby
96
98
  client = DocusignRest::Client.new
97
99
  document_envelope_response = client.create_envelope_from_document(
@@ -104,14 +106,35 @@ document_envelope_response = client.create_envelope_from_document(
104
106
  # iFrame by using the client.get_recipient_view method
105
107
  signers: [
106
108
  {
107
- #embedded: true,
109
+ embedded: true,
108
110
  name: 'Test Guy',
109
- email: 'someone@gmail.com'
111
+ email: 'someone@gmail.com',
112
+ role_name: 'Issuer',
113
+ sign_here_tabs: [
114
+ {
115
+ anchor_string: 'sign_here_1',
116
+ anchor_x_offset: '140',
117
+ anchor_y_offset: '8'
118
+ }
119
+ ]
110
120
  },
111
121
  {
112
- #embedded: true,
122
+ embedded: true,
113
123
  name: 'Test Girl',
114
- email: 'someone+else@gmail.com'
124
+ email: 'someone+else@gmail.com',
125
+ role_name: 'Attorney',
126
+ sign_here_tabs: [
127
+ {
128
+ anchor_string: 'sign_here_2',
129
+ anchor_x_offset: '140',
130
+ anchor_y_offset: '8'
131
+ },
132
+ {
133
+ anchor_string: 'sign_here_3',
134
+ anchor_x_offset: '140',
135
+ anchor_y_offset: '8'
136
+ }
137
+ ]
115
138
  }
116
139
  ],
117
140
  files: [
@@ -136,14 +159,26 @@ client = DocusignRest::Client.new
136
159
  name: 'jon',
137
160
  email: 'someone@gmail.com',
138
161
  role_name: 'Issuer',
139
- anchor_string: 'issuer_sig'
162
+ sign_here_tabs: [
163
+ {
164
+ anchor_string: 'issuer_sig',
165
+ anchor_x_offset: '140',
166
+ anchor_y_offset: '8'
167
+ }
168
+ ]
140
169
  },
141
170
  {
142
171
  embedded: true,
143
172
  name: 'tim',
144
173
  email: 'someone+else@gmail.com',
145
174
  role_name: 'Attorney',
146
- anchor_string: 'attorney_sig'
175
+ sign_here_tabs: [
176
+ {
177
+ anchor_string: 'attorney_sig',
178
+ anchor_x_offset: '140',
179
+ anchor_y_offset: '8'
180
+ }
181
+ ]
147
182
  }
148
183
  ],
149
184
  files: [
@@ -260,33 +260,36 @@ module DocusignRest
260
260
  \"numberTabs\":null,
261
261
  \"radioGroupTabs\":null,
262
262
  \"signHereTabs\":[
263
- {
264
- \"anchorString\":\"#{signer[:anchor_string]}\",
265
- \"anchorXOffset\": \"#{signer[:anchor_x_offset] || '0'}\",
266
- \"anchorYOffset\": \"#{signer[:anchor_y_offset] || '0'}\",
267
- \"anchorIgnoreIfNotPresent\": #{signer[:ignore_anchor_if_not_present] || false},
268
- \"anchorUnits\": \"pixels\",
269
- \"conditionalParentLabel\": null,
270
- \"conditionalParentValue\": null,
271
- \"documentId\":\"#{signer[:document_id] || '1'}\",
272
- \"pageNumber\":\"#{signer[:page_number] || '1'}\",
273
- \"recipientId\":\"#{index+1}\",
274
- "
275
- if options[:template] == true
276
- doc_signer << "
277
- \"templateLocked\":#{signer[:template_locked] || true},
278
- \"templateRequired\":#{signer[:template_required] || true},
279
- "
280
- end
263
+ "
264
+ signer[:sign_here_tabs].each do |sign_here_tab|
265
+ doc_signer << "{
266
+ \"anchorString\":\"#{sign_here_tab[:anchor_string]}\",
267
+ \"anchorXOffset\": \"#{sign_here_tab[:anchor_x_offset] || '0'}\",
268
+ \"anchorYOffset\": \"#{sign_here_tab[:anchor_y_offset] || '0'}\",
269
+ \"anchorIgnoreIfNotPresent\": #{sign_here_tab[:ignore_anchor_if_not_present] || false},
270
+ \"anchorUnits\": \"pixels\",
271
+ \"conditionalParentLabel\": null,
272
+ \"conditionalParentValue\": null,
273
+ \"documentId\":\"#{sign_here_tab[:document_id] || '1'}\",
274
+ \"pageNumber\":\"#{sign_here_tab[:page_number] || '1'}\",
275
+ \"recipientId\":\"#{index+1}\",
276
+ "
277
+ if options[:template] == true
281
278
  doc_signer << "
282
- \"xPosition\":\"#{signer[:x_position] || '0'}\",
283
- \"yPosition\":\"#{signer[:y_position] || '0'}\",
284
- \"name\":\"#{signer[:sign_here_tab_text] || 'Sign Here'}\",
285
- \"optional\":false,
286
- \"scaleValue\":1,
287
- \"tabLabel\":\"#{signer[:tab_label] || 'Signature 1'}\"
288
- },
289
- ],
279
+ \"templateLocked\":#{sign_here_tab[:template_locked] || true},
280
+ \"templateRequired\":#{sign_here_tab[:template_required] || true},
281
+ "
282
+ end
283
+ doc_signer << "
284
+ \"xPosition\":\"#{sign_here_tab[:x_position] || '0'}\",
285
+ \"yPosition\":\"#{sign_here_tab[:y_position] || '0'}\",
286
+ \"name\":\"#{sign_here_tab[:sign_here_tab_text] || 'Sign Here'}\",
287
+ \"optional\":false,
288
+ \"scaleValue\":1,
289
+ \"tabLabel\":\"#{sign_here_tab[:tab_label] || 'Signature 1'}\"
290
+ },"
291
+ end
292
+ doc_signer << "],
290
293
  \"signerAttachmentTabs\":null,
291
294
  \"ssnTabs\":null,
292
295
  \"textTabs\":null,
@@ -1,3 +1,3 @@
1
1
  module DocusignRest
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -97,18 +97,26 @@ describe DocusignRest::Client do
97
97
  name: 'Test Guy',
98
98
  email: 'testguy@gmail.com',
99
99
  role_name: 'Issuer',
100
- anchor_string: 'sign here',
101
- anchor_x_offset: '125',
102
- anchor_y_offset: '-12'
100
+ sign_here_tabs: [
101
+ {
102
+ anchor_string: 'sign here',
103
+ anchor_x_offset: '125',
104
+ anchor_y_offset: '-12'
105
+ }
106
+ ]
103
107
  },
104
108
  {
105
109
  embedded: true,
106
110
  name: 'Test Girl',
107
111
  email: 'testgirl@gmail.com',
108
112
  role_name: 'Attorney',
109
- anchor_string: 'sign here',
110
- anchor_x_offset: '140',
111
- anchor_y_offset: '-12'
113
+ sign_here_tabs: [
114
+ {
115
+ anchor_string: 'sign here',
116
+ anchor_x_offset: '140',
117
+ anchor_y_offset: '-12'
118
+ }
119
+ ]
112
120
  }
113
121
  ],
114
122
  files: [
@@ -134,10 +142,14 @@ describe DocusignRest::Client do
134
142
  name: 'jon',
135
143
  email: 'someone@gmail.com',
136
144
  role_name: 'Issuer',
137
- anchor_string: 'sign here',
138
- template_locked: true, #doesn't seem to do anything
139
- template_required: true, #doesn't seem to do anything
140
- email_notification: false #FIXME if signer is setup as 'embedded' initial email notifications don't go out, but even when I set up a signer as non-embedded this setting didn't seem to make the email notifications actually stop...
145
+ sign_here_tabs: [
146
+ {
147
+ anchor_string: 'sign here',
148
+ template_locked: true, #doesn't seem to do anything
149
+ template_required: true, #doesn't seem to do anything
150
+ email_notification: false #FIXME if signer is setup as 'embedded' initial email notifications don't go out, but even when I set up a signer as non-embedded this setting didn't seem to make the email notifications actually stop...
151
+ }
152
+ ]
141
153
  }
142
154
  ],
143
155
  files: [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docusign_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2012-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multipart-post