22
33/**
44 * The MIT License (MIT)
5- *
5+ *
66 * Copyright (C) 2015 hellosign.com
7- *
7+ *
88 * Permission is hereby granted, free of charge, to any person obtaining a copy
99 * of this software and associated documentation files (the "Software"), to deal
1010 * in the Software without restriction, including without limitation the rights
3838
3939/**
4040 * Represents a HelloSign signature request based on one or more Templates.
41- *
41+ *
4242 * Unlike the SignatureRequest, this object is only used to submit the request.
4343 * A successfully submitted TemplateSignatureRequest will return a
4444 * SignatureRequest object from the server.
45- *
45+ *
4646 * @author "Chris Paul ([email protected] )" 4747 */
4848public class TemplateSignatureRequest extends AbstractRequest {
@@ -69,7 +69,7 @@ public TemplateSignatureRequest() {
6969
7070 /**
7171 * Convenience constructor that accepts a single Template.
72- *
72+ *
7373 * @param template Template
7474 * @throws HelloSignException thrown if there is a problem adding the
7575 * template ID.
@@ -81,7 +81,7 @@ public TemplateSignatureRequest(Template template) throws HelloSignException {
8181
8282 /**
8383 * Convenience constructor that accepts a list of Templates.
84- *
84+ *
8585 * @param templates List
8686 * @throws HelloSignException thrown if there is a problem adding the
8787 * template ID.
@@ -95,7 +95,7 @@ public TemplateSignatureRequest(List<Template> templates) throws HelloSignExcept
9595
9696 /**
9797 * Returns a reference to the map of current roles to CC email addresses.
98- *
98+ *
9999 * @return Map
100100 */
101101 public Map <String , String > getCCs () {
@@ -104,7 +104,7 @@ public Map<String, String> getCCs() {
104104
105105 /**
106106 * Overwrites the map of roles to CC email addresses.
107- *
107+ *
108108 * @param newCCs Map
109109 */
110110 public void setCCs (Map <String , String > newCCs ) {
@@ -113,7 +113,7 @@ public void setCCs(Map<String, String> newCCs) {
113113
114114 /**
115115 * Sets the CC email address for the provided role.
116- *
116+ *
117117 * @param role String
118118 * @param email String
119119 */
@@ -130,7 +130,7 @@ public void clearCCs() {
130130
131131 /**
132132 * Adds the signer to the list of signers for this request.
133- *
133+ *
134134 * @param role String
135135 * @param email String
136136 * @param name String
@@ -145,7 +145,7 @@ public void setSigner(String role, String email, String name) throws HelloSignEx
145145 * Returns a reference to the signers list. This can be modified and
146146 * re-added to the request using setSigners(). Useful for more explicit
147147 * modification.
148- *
148+ *
149149 * @return List
150150 */
151151 public Map <String , Signer > getSigners () {
@@ -155,7 +155,7 @@ public Map<String, Signer> getSigners() {
155155 /**
156156 * Overwrites the current list of signers for this request with the given
157157 * list.
158- *
158+ *
159159 * @param signers List
160160 */
161161 public void setSigners (Map <String , Signer > signers ) {
@@ -166,7 +166,7 @@ public void setSigners(Map<String, Signer> signers) {
166166 * Removes signer(s) from this request by email address. If more than one
167167 * signer is listed by the given email, it will remove all instances of that
168168 * signer. If no user is listed by the given email, nothing will happen.
169- *
169+ *
170170 * @param email String
171171 * @throws HelloSignException if there is a problem removing the signer by
172172 * email.
@@ -185,7 +185,7 @@ public void removeSignerByEmail(String email) throws HelloSignException {
185185 /**
186186 * Add the custom field to this request. This is useful for specifying a
187187 * pre-filled value and/or a field editor.
188- *
188+ *
189189 * @param field CustomField
190190 */
191191 public void addCustomField (CustomField field ) {
@@ -194,7 +194,7 @@ public void addCustomField(CustomField field) {
194194
195195 /**
196196 * Adds the value to fill in for a custom field with the given field name.
197- *
197+ *
198198 * @param fieldNameOrApiId String name (or "Field Label") of the custom field
199199 * to be filled in. The "api_id" can also be used instead of the name.
200200 * @param value String value
@@ -209,7 +209,7 @@ public void setCustomFieldValue(String fieldNameOrApiId, String value) {
209209 /**
210210 * Returns the map of custom fields for the template. This is a map of
211211 * String field names to String field values.
212- *
212+ *
213213 * @return Map
214214 */
215215 public Map <String , String > getCustomFields () {
@@ -222,7 +222,7 @@ public Map<String, String> getCustomFields() {
222222
223223 /**
224224 * Returns a list of CustomField objects for this template.
225- *
225+ *
226226 * @return List of CustomFields
227227 */
228228 public List <CustomField > getCustomFieldsList () {
@@ -232,7 +232,7 @@ public List<CustomField> getCustomFieldsList() {
232232 /**
233233 * Overwrites the current map of custom fields to the provided map. This is
234234 * a map of String field names to String field values.
235- *
235+ *
236236 * @param fields Map
237237 */
238238 public void setCustomFields (Map <String , String > fields ) {
@@ -255,7 +255,7 @@ public void clearCustomFields() {
255255 /**
256256 * Set the template ID of the template that should be used with this
257257 * request.
258- *
258+ *
259259 * @param id String
260260 * @throws HelloSignException thrown if the template ID cannot be added.
261261 */
@@ -266,7 +266,7 @@ public void setTemplateId(String id) throws HelloSignException {
266266
267267 /**
268268 * Get the template ID that will be used with this request.
269- *
269+ *
270270 * @return String
271271 * @throws HelloSignException thrown if there is a problem parsing the
272272 * backing JSON object.
@@ -281,7 +281,7 @@ public String getTemplateId() throws HelloSignException {
281281
282282 /**
283283 * Adds the template ID to be used in this request.
284- *
284+ *
285285 * @param id String
286286 * @throws HelloSignException thrown if there is a problem parsing the
287287 * backing JSON object.
@@ -292,7 +292,7 @@ public void addTemplateId(String id) throws HelloSignException {
292292
293293 /**
294294 * Add the template ID to be used at the specified index.
295- *
295+ *
296296 * @param id String
297297 * @param index Integer
298298 * @throws HelloSignException thrown if therer is a problem adding the given
@@ -326,7 +326,7 @@ public void addTemplateId(String id, Integer index) throws HelloSignException {
326326
327327 /**
328328 * Get the list of template IDs that are used for this request.
329- *
329+ *
330330 * @return List
331331 */
332332 public List <String > getTemplateIds () {
@@ -336,7 +336,7 @@ public List<String> getTemplateIds() {
336336 /**
337337 * Internal method used to retrieve the necessary POST fields to submit the
338338 * signature request.
339- *
339+ *
340340 * @return Map
341341 * @throws HelloSignException thrown if there is a problem parsing the POST
342342 * fields.
@@ -366,6 +366,9 @@ public Map<String, Serializable> getPostFields() throws HelloSignException {
366366 if (hasMessage ()) {
367367 fields .put (REQUEST_MESSAGE , getMessage ());
368368 }
369+ if (hasRedirectUrl ()) {
370+ fields .put (REQUEST_REDIRECT_URL , getRedirectUrl ());
371+ }
369372 Map <String , String > ccz = getCCs ();
370373 for (String role : ccz .keySet ()) {
371374 fields .put (TEMPLATE_CCS + "[" + role + "][" + TEMPLATE_CCS_EMAIL + "]" , ccz .get (role ));
0 commit comments