Skip to content

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jondkinney committed May 16, 2014
2 parents 009cb58 + 87cead4 commit df26720
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
54 changes: 52 additions & 2 deletions lib/docusign_rest/client.rb
Expand Up @@ -222,6 +222,7 @@ def get_template_roles(signers)
tabs: {
textTabs: get_signer_tabs(signer[:text_tabs]),
checkboxTabs: get_signer_tabs(signer[:checkbox_tabs]),
numberTabs: get_signer_tabs(signer[:number_tabs]),
fullNameTabs: get_signer_tabs(signer[:fullname_tabs]),
dateTabs: get_signer_tabs(signer[:date_tabs])
}
Expand Down Expand Up @@ -869,7 +870,7 @@ def get_console_view(options={})
#
# include_tabs - boolean, determines if the tabs for each signer will be
# returned in the response, defaults to false.
# envelope_id - ID of the envelope for which you want to retrive the
# envelope_id - ID of the envelope for which you want to retrieve the
# signer info
# headers - optional hash of headers to merge into the existing
# required headers for a multipart request.
Expand Down Expand Up @@ -993,7 +994,7 @@ def get_documents_from_envelope(options={})

JSON.parse(response.body)
end

# Public retrieves a PDF containing the combined content of all
# documents and the certificate for the given envelope.
#
Expand Down Expand Up @@ -1220,5 +1221,54 @@ def get_envelope(envelope_id)
response = http.request(request)
JSON.parse(response.body)
end

# Public deletes a recipient for a given envelope
#
# envelope_id - ID of the envelope for which you want to retrieve the
# signer info
# recipient_id - ID of the recipient to delete
#
# Returns a hash of recipients with an error code for any recipients that
# were not successfully deleted.
def delete_envelope_recipient(options={})
content_type = {'Content-Type' => 'application/json'}
content_type.merge(options[:headers]) if options[:headers]

uri = build_uri("/accounts/#{@acct_id}/envelopes/#{options[:envelope_id]}/recipients")
post_body = "{
\"signers\" : [{\"recipientId\" : \"#{options[:recipient_id]}\"}]
}"

http = initialize_net_http_ssl(uri)
request = Net::HTTP::Delete.new(uri.request_uri, headers(content_type))
request.body = post_body

response = http.request(request)
parsed_response = JSON.parse(response.body)
end

# Public voids an in-process envelope
#
# envelope_id - ID of the envelope to be voided
# voided_reason - Optional reason for the envelope being voided
#
# Returns the response (success or failure).
def void_envelope(options = {})
content_type = { 'Content-Type' => 'application/json' }
content_type.merge(options[:headers]) if options[:headers]

post_body = {
"status" =>"voided",
"voidedReason" => options[:voided_reason] || "No reason provided."
}.to_json

uri = build_uri("/accounts/#{acct_id}/envelopes/#{options[:folder_id]}")

http = initialize_net_http_ssl(uri)
request = Net::HTTP::Put.new(uri.request_uri, headers(content_type))
request.body = post_body
response = http.request(request)
response
end
end
end
2 changes: 1 addition & 1 deletion test/docusign_rest/client_test.rb
Expand Up @@ -263,4 +263,4 @@
end
end
end
end
end

0 comments on commit df26720

Please sign in to comment.