Skip to content

Commit

Permalink
Merge pull request #131 from docusign/DEVDOCS-10350
Browse files Browse the repository at this point in the history
adding codeDepot markers
  • Loading branch information
raileendr authored Jul 7, 2023
2 parents 6bc79d6 + e72b578 commit 7417f92
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/services/e_sign/eg017_set_template_tab_values_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ def initialize(args)
@args = args
end

# ***DS.snippet.0.start
def worker
signer_client_id = 1000
envelope_args = args[:envelope_args]
ds_ping_url = envelope_args[:ds_ping_url]
ds_return_url = "#{ds_ping_url}/ds_common-return"

# Step 4. Construct the request body
#ds-snippet-start:eSign17Step4
envelope_definition = make_envelope(envelope_args)
#ds-snippet-end:eSign17Step4

# Step 5. Call the eSignature REST API
#ds-snippet-start:eSign17Step5
envelope_api = create_envelope_api(args)
results = envelope_api.create_envelope args[:account_id], envelope_definition
envelope_id = results.envelope_id
#ds-snippet-end:eSign17Step5

# Step 6. Create the View Request
#ds-snippet-start:eSign17Step6
view_request = make_recipient_view_request(envelope_args[:signer_email], envelope_args[:signer_name], signer_client_id, ds_return_url, ds_ping_url)

# Call the CreateRecipientView API
Expand All @@ -36,6 +40,7 @@ def worker
# query parameter on the return URL (see the makeRecipientViewRequest method)
# Redirect to results.url
results.url
#ds-snippet-end:eSign17Step6
end

private
Expand Down Expand Up @@ -64,6 +69,7 @@ def make_envelope(args)
# Step 3. Create Tabs and CustomFields

# List item
#ds-snippet-start:eSign17Step3
list1 = DocuSign_eSign::List.new
list1.value = 'Green'
list1.document_id = '1'
Expand Down Expand Up @@ -118,6 +124,7 @@ def make_envelope(args)
# Add the TemplateRole objects to the envelope object
envelope_definition.template_roles = [signer, cc]
envelope_definition
#ds-snippet-end:eSign17Step3
end

def make_recipient_view_request(signer_email, signer_name, signer_client_id, ds_return_url, ds_ping_url)
Expand Down Expand Up @@ -148,5 +155,4 @@ def make_recipient_view_request(signer_email, signer_name, signer_client_id, ds_

view_request
end
# ***DS.snippet.0.end
end

0 comments on commit 7417f92

Please sign in to comment.